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';
55import 'package:ht_shared/ht_shared.dart' ;
66import 'package:uuid/uuid.dart' ;
77
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-
188/// {@template jwt_auth_token_service}
199/// An implementation of [AuthTokenService] using JSON Web Tokens (JWT).
2010///
@@ -70,9 +60,7 @@ class JwtAuthTokenService implements AuthTokenService {
7060 'jti' : _uuid.v4 (), // JWT ID (for potential blacklisting)
7161 // Custom claims (optional, include what's useful)
7262 '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
7664 },
7765 issuer: _issuer,
7866 subject: user.id,
You can’t perform that action at this time.
0 commit comments