File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,6 @@ import 'package:ht_data_repository/ht_data_repository.dart';
5
5
import 'package:ht_shared/ht_shared.dart' ;
6
6
import 'package:uuid/uuid.dart' ;
7
7
8
- /// Helper function to convert UserRole enum to its snake_case string.
9
- String _userRoleToString (UserRole role) {
10
- return switch (role) {
11
- UserRole .admin => 'admin' ,
12
- UserRole .standardUser => 'standard_user' ,
13
- UserRole .guestUser => 'guest_user' ,
14
- UserRole .premiumUser => 'premium_user' ,
15
- };
16
- }
17
-
18
8
/// {@template jwt_auth_token_service}
19
9
/// An implementation of [AuthTokenService] using JSON Web Tokens (JWT).
20
10
///
@@ -70,9 +60,7 @@ class JwtAuthTokenService implements AuthTokenService {
70
60
'jti' : _uuid.v4 (), // JWT ID (for potential blacklisting)
71
61
// Custom claims (optional, include what's useful)
72
62
'email' : user.email,
73
- 'role' : _userRoleToString (
74
- user.role,
75
- ), // Include the user's role as a string
63
+ 'roles' : user.roles, // Include the user's roles as a list of strings
76
64
},
77
65
issuer: _issuer,
78
66
subject: user.id,
You can’t perform that action at this time.
0 commit comments