Skip to content

Commit 887b93f

Browse files
committed
fix(auth): handle missing subject claim in JWT
- Throw BadRequestException - Improve error handling
1 parent 725da65 commit 887b93f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/services/jwt_auth_token_service.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ class JwtAuthTokenService implements AuthTokenService {
9292
print('Token validation failed: Missing "sub" claim.');
9393
// Throw specific exception for malformed token
9494
throw const BadRequestException(
95-
'Malformed token: Missing subject claim.',);
95+
'Malformed token: Missing subject claim.',
96+
);
9697
}
9798

9899
// Fetch the full user object from the repository

0 commit comments

Comments
 (0)