File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,15 @@ class ParseUser extends ParseObject implements ParseCloneable {
62
62
/// Current user is stored locally, but in case of a server update [bool]
63
63
/// fromServer can be called and an updated version of the [User] object will be
64
64
/// returned
65
- Future <ParseResponse > getCurrentUserFromServer () async {
65
+ Future <ParseResponse > getCurrentUserFromServer ({token} ) async {
66
66
// We can't get the current user and session without a sessionId
67
- if (_client.data.sessionId == null ) return null ;
67
+ if (token == null && _client.data.sessionId == null ) {
68
+ return null ;
69
+ }
70
+
71
+ if (token == null ){
72
+ token = _client.data.sessionId;
73
+ }
68
74
69
75
try {
70
76
Uri tempUri = Uri .parse (_client.data.serverUrl);
@@ -74,7 +80,7 @@ class ParseUser extends ParseObject implements ParseCloneable {
74
80
host: tempUri.host,
75
81
path: "${tempUri .path }$keyEndPointUserName " );
76
82
77
- final response = await _client.get (uri, headers: {keyHeaderSessionToken: _client.data.sessionId });
83
+ final response = await _client.get (uri, headers: {keyHeaderSessionToken: token });
78
84
return _handleResponse (response, ParseApiRQ .currentUser);
79
85
} on Exception catch (e) {
80
86
return _handleException (e, ParseApiRQ .currentUser);
You can’t perform that action at this time.
0 commit comments