Skip to content

Commit af75550

Browse files
committed
Fix: Login at web
1 parent cd4996a commit af75550

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.14
2+
3+
* Login at web should work
4+
15
## 0.0.13
26

37
* Improvement: CloudFile with getters fileId, fileName and mimeType

lib/fl_cloud_storage/cloud_storage_service.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:logger/logger.dart';
88
/// Root logger.
99
final Logger log = Logger(
1010
printer: MyPrinter('FL_CLOUD_STORAGE'),
11-
level: Level.trace,
11+
level: Level.verbose,
1212
);
1313

1414
/// This class is the entrypoint for the fl_cloud_storage package. It is a
@@ -202,4 +202,4 @@ class CloudStorageService {
202202
}
203203
return null;
204204
}
205-
}
205+
}

lib/fl_cloud_storage/vendor/google_drive/google_drive_service.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ class GoogleDriveService
107107
final GoogleSignInAccount? account = await _getGoogleUser(googleSignIn);
108108

109109
final isAuthorizedForMobile = !kIsWeb && account != null;
110-
final isAuthorizedForWeb = kIsWeb && account != null && await googleSignIn.canAccessScopes(googleSignIn.scopes);
110+
final isAuthorizedForWeb = kIsWeb &&
111+
account != null &&
112+
await googleSignIn.canAccessScopes(googleSignIn.scopes);
111113
if (!isAuthorizedForMobile && !isAuthorizedForWeb) {
112114
throw Exception('User is not authorized!');
113115
}
114116

115117
final GoogleSignInAuthentication googleAuth = await account.authentication;
116-
_authenticationTokens = AuthenticationTokens(accessToken: googleAuth.accessToken, idToken: googleAuth.idToken);
118+
_authenticationTokens = AuthenticationTokens(
119+
accessToken: googleAuth.accessToken, idToken: googleAuth.idToken);
117120

118121
// set auth headers for the drive api
119122
final Map<String, String> authHeaders = await account.authHeaders;
@@ -407,4 +410,4 @@ class GoogleDriveService
407410
? GoogleDriveFolder(folder: res.files![0])
408411
: null;
409412
}
410-
}
413+
}

0 commit comments

Comments
 (0)