This commit is contained in:
efrilm
2025-11-10 17:23:26 +07:00
parent 0a8f8d93bb
commit b2b2e2b111
12 changed files with 625 additions and 98 deletions
@@ -57,4 +57,21 @@ class AuthRepository implements IAuthRepository {
Future<bool> hasToken() async {
return await _localDataProvider.hasToken();
}
@override
Future<Either<AuthFailure, Unit>> logout() async {
try {
final result = await _dataProvider.logout();
if (result.hasError) {
return left(result.error!);
}
await _localDataProvider.deleteAllAuth();
return right(unit);
} catch (e, s) {
log('logoutError', name: _logName, error: e, stackTrace: s);
return left(const AuthFailure.unexpectedError());
}
}
}