File tree Expand file tree Collapse file tree
frontend/lib/core/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929tmp
3030
3131concat.conf
32+
33+ notes.py
Original file line number Diff line number Diff line change @@ -5,43 +5,6 @@ import 'package:resellio/core/repositories/repositories.dart';
55import 'package:resellio/core/utils/jwt_decoder.dart' ;
66import 'package:resellio/presentation/common_widgets/adaptive_navigation.dart' ;
77
8- class UserModel {
9- final int userId;
10- final String email;
11- final String name;
12- final UserRole role;
13- final int roleId;
14-
15- UserModel (
16- {required this .userId,
17- required this .email,
18- required this .name,
19- required this .role,
20- required this .roleId});
21-
22- factory UserModel .fromJwt (Map <String , dynamic > jwtData) {
23- UserRole role;
24- switch (jwtData['role' ]) {
25- case 'organizer' :
26- role = UserRole .organizer;
27- break ;
28- case 'administrator' :
29- role = UserRole .admin;
30- break ;
31- default :
32- role = UserRole .customer;
33- }
34-
35- return UserModel (
36- userId: jwtData['user_id' ],
37- email: jwtData['sub' ],
38- name: jwtData['name' ] ?? 'User' ,
39- role: role,
40- roleId: jwtData['role_id' ],
41- );
42- }
43- }
44-
458class AuthService extends ChangeNotifier {
469 final AuthRepository _authRepository;
4710 final UserRepository _userRepository;
You can’t perform that action at this time.
0 commit comments