verify repo
This commit is contained in:
@@ -57,7 +57,31 @@ class AuthRepository implements IAuthRepository {
|
||||
|
||||
return right(auth);
|
||||
} catch (e, s) {
|
||||
log('checkPhoneError', name: _logName, error: e, stackTrace: s);
|
||||
log('registerError', name: _logName, error: e, stackTrace: s);
|
||||
return left(const AuthFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<AuthFailure, Verify>> verify({
|
||||
required String registrationToken,
|
||||
required String otpCode,
|
||||
}) async {
|
||||
try {
|
||||
final result = await _remoteDataProvider.verify(
|
||||
registrationToken: registrationToken,
|
||||
otpCode: otpCode,
|
||||
);
|
||||
|
||||
if (result.hasError) {
|
||||
return left(result.error!);
|
||||
}
|
||||
|
||||
final auth = result.data!.toDomain();
|
||||
|
||||
return right(auth);
|
||||
} catch (e, s) {
|
||||
log('verifyError', name: _logName, error: e, stackTrace: s);
|
||||
return left(const AuthFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user