Skip to content

Commit ae467f3

Browse files
committed
fix(auth): handle token invalidation errors
- Improved error handling - Added const to exception
1 parent aa0852e commit ae467f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/src/services/auth_service.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,16 @@ class AuthService {
213213
try {
214214
// Invalidate the token using the AuthTokenService
215215
await _authTokenService.invalidateToken(token);
216-
print('[AuthService] Token invalidation logic executed for user $userId.');
216+
print(
217+
'[AuthService] Token invalidation logic executed for user $userId.');
217218
} on HtHttpException catch (_) {
218219
// Propagate known exceptions from the token service
219220
rethrow;
220221
} catch (e) {
221222
// Catch unexpected errors during token invalidation
222-
print('[AuthService] Error during token invalidation for user $userId: $e');
223-
throw OperationFailedException(
223+
print(
224+
'[AuthService] Error during token invalidation for user $userId: $e');
225+
throw const OperationFailedException(
224226
'Failed server-side sign-out: Token invalidation failed.',
225227
);
226228
}

0 commit comments

Comments
 (0)