loginWithToken method
Step 3a: Login an existing user using the temp token from verifyOtp.
Implementation
Future<bool> loginWithToken(String phoneGrantToken) async {
state = state.copyWith(status: AuthStatus.authenticating, error: null);
try {
final tokens = await _phoneAuthService.loginWithToken(phoneGrantToken);
await _applyTokens(tokens);
return true;
} on DioException catch (e) {
_handleError(e);
return false;
}
}