verify repo

This commit is contained in:
efrilm
2025-09-18 06:38:50 +07:00
parent 13c55afe3c
commit c40f96fc88
16 changed files with 1547 additions and 1 deletions
@@ -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());
}
}