File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -827,8 +827,7 @@ class GoTrueClient {
827
827
final accessToken = currentSession? .accessToken;
828
828
829
829
if (scope != SignOutScope .others) {
830
- _currentSession = null ;
831
- _currentUser = null ;
830
+ _removeSession ();
832
831
await _asyncStorage? .removeItem (
833
832
key: '${Constants .defaultStorageKey }-code-verifier' );
834
833
notifyAllSubscribers (AuthChangeEvent .signedOut);
@@ -1116,6 +1115,11 @@ class GoTrueClient {
1116
1115
_currentUser = session.user;
1117
1116
}
1118
1117
1118
+ void _removeSession () {
1119
+ _currentSession = null ;
1120
+ _currentUser = null ;
1121
+ }
1122
+
1119
1123
/// Generates a new JWT.
1120
1124
///
1121
1125
/// To prevent multiple simultaneous requests it catches an already ongoing request by using the global [_refreshTokenCompleter] .
@@ -1150,6 +1154,7 @@ class GoTrueClient {
1150
1154
return data;
1151
1155
} on AuthException catch (error, stack) {
1152
1156
if (error is ! AuthRetryableFetchException ) {
1157
+ _removeSession ();
1153
1158
notifyAllSubscribers (AuthChangeEvent .signedOut);
1154
1159
} else {
1155
1160
_onAuthStateChangeController.addError (error, stack);
You can’t perform that action at this time.
0 commit comments