Skip to content

Commit a6823b4

Browse files
author
Patrick FINKELSTEIN
committed
changed parameters in Oauth and Strava
1 parent cbe4461 commit a6823b4

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

example/lib/examples.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ import 'package:strava_flutter/Models/summaryActivity.dart';
4646

4747
// Do authentication with the right scope
4848
final strava = Strava(true, // To get display info in API
49-
secret, 'auto');
49+
secret);
5050

5151
bool isAuthOk = false;
5252

53-
isAuthOk = await strava.OAuth(clientID, "http://localhost:8080", 'activity:write', secret);
53+
isAuthOk = await strava.OAuth(clientID, 'activity:write', secret, 'auto');
5454

5555
print('---> Authentication result: $isAuthOk');
5656

@@ -80,7 +80,7 @@ void example(String secret) async {
8080

8181
bool isAuthOk = false;
8282

83-
final strava = Strava(true,
83+
final strava = Strava(false,
8484
secret);
8585
final prompt = 'auto';
8686

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class _StravaFlutterPageState extends State<StravaFlutterPage> {
7171
final strava = Strava(
7272
true, // to get disply info in API
7373
secret, // Put your secret key in secret.dart file
74-
'auto', // Prompt strava login only when needed
7574
);
7675
await strava.deAuthorize();
7776
}

lib/API/Oauth.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class Auth {
124124
/// Do/show the Strava login if the scope has been changed since last storage of the token
125125
/// return true if no problem in authentication has been found
126126
Future<bool> OAuth(
127-
String clientID, String scope, String secret, String promt) async {
127+
String clientID, String scope, String secret, String prompt) async {
128128
print('Welcome to Oauth');
129129
bool isAuthOk = false;
130130
bool isExpired = true;

lib/API/strava.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ import 'clubs.dart';
2323
/// prompt: to choose to ask Strava always to authenticate or only when needed (with 'auto')
2424
/// scope: Strava scope check https://developers.strava.com/docs/oauth-updates/
2525
class Strava with Upload, Auth, Clubs {
26-
Strava( this.isInDebug, this.secret);
27-
final bool isInDebug;
28-
final String secret;
29-
26+
String secret;
27+
28+
Strava (bool isInDebug, String secretKey) {
29+
globals.isInDebug = isInDebug;
30+
secret = secretKey;
31+
}
3032

33+
// Strava( this.isInDebug, this.secret);
34+
// final bool isInDebug;
35+
// final String secret;
36+
3137

3238
/// List of statuscode used by Fault
3339
/// To get info to API caller
@@ -39,6 +45,8 @@ final statusHeaderIsEmpty = 3;
3945
final statusNotFound = 4;
4046

4147

48+
49+
4250
/// getRunningRacebyId
4351
///
4452
/// Scope needed: none

0 commit comments

Comments
 (0)