updateAuth method
- @Deprecated("Shutdown SDK instead.")
- @override
- MoveAuth moveAuth
override
Updates the user's provided Auth upon its expiry. Auth expiry triggers the SDK Auth State change listener.
Warning:
- Only the user's token is expected to update. Changing any other
user's auth param will fail with
MoveAuthError.authInvalid.moveAuthmust contain new valid authentication data. Returns an error if failed.
Implementation
@Deprecated("Shutdown SDK instead.")
@override
Future<MoveAuthError?> updateAuth(MoveAuth moveAuth) async {
try {
await methodChannel.invokeMethod(
'updateAuth',
<String, dynamic>{
'projectId': moveAuth.projectId,
'accessToken': moveAuth.accessToken,
'userId': moveAuth.userId,
'refreshToken': moveAuth.refreshToken,
},
);
} on PlatformException catch (e) {
switch (e.code) {
case "authInvalid":
return MoveAuthError.authInvalid;
case "serviceUnreachable":
return MoveAuthError.serviceUnreachable;
case "throttle":
return MoveAuthError.throttle;
}
}
return null;
}