@flusys/nestjs-auth 1.0.0-beta → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +590 -473
  2. package/cjs/config/auth.constants.js +12 -0
  3. package/cjs/controllers/authentication.controller.js +365 -24
  4. package/cjs/controllers/branch.controller.js +44 -1
  5. package/cjs/controllers/company-selection.controller.js +27 -20
  6. package/cjs/controllers/company.controller.js +44 -1
  7. package/cjs/controllers/user-permission.controller.js +82 -154
  8. package/cjs/controllers/user.controller.js +211 -7
  9. package/cjs/docs/auth-swagger.config.js +14 -7
  10. package/cjs/dtos/authentication.dto.js +114 -38
  11. package/cjs/dtos/index.js +0 -1
  12. package/cjs/dtos/user-permission.dto.js +28 -0
  13. package/cjs/dtos/user.dto.js +19 -4
  14. package/cjs/entities/index.js +5 -1
  15. package/cjs/entities/pending-registration.entity.js +125 -0
  16. package/cjs/entities/user-company-permission.entity.js +3 -9
  17. package/cjs/entities/user-token.entity.js +129 -0
  18. package/cjs/interceptors/clear-token.interceptor.js +10 -23
  19. package/cjs/interceptors/set-token.interceptor.js +15 -55
  20. package/cjs/interfaces/auth-email-provider.interface.js +45 -0
  21. package/cjs/interfaces/index.js +2 -0
  22. package/cjs/interfaces/user-enricher.interface.js +4 -0
  23. package/cjs/modules/auth.module.js +65 -143
  24. package/cjs/services/auth-config.service.js +25 -27
  25. package/cjs/services/auth-datasource.provider.js +13 -23
  26. package/cjs/services/auth-email.service.js +456 -0
  27. package/cjs/services/authentication.service.js +297 -349
  28. package/cjs/services/branch.service.js +9 -4
  29. package/cjs/services/company-selection-session.service.js +1 -1
  30. package/cjs/services/index.js +1 -0
  31. package/cjs/services/user-permission.service.js +43 -73
  32. package/cjs/services/user.service.js +184 -34
  33. package/cjs/strategies/jwt.strategy.js +44 -44
  34. package/cjs/validators/password.validator.js +45 -0
  35. package/config/auth.constants.d.ts +3 -0
  36. package/controllers/authentication.controller.d.ts +16 -10
  37. package/controllers/company-selection.controller.d.ts +6 -2
  38. package/controllers/user-permission.controller.d.ts +5 -4
  39. package/controllers/user.controller.d.ts +33 -0
  40. package/dtos/authentication.dto.d.ts +20 -6
  41. package/dtos/company-branch.dto.d.ts +0 -1
  42. package/dtos/company.dto.d.ts +0 -1
  43. package/dtos/index.d.ts +0 -1
  44. package/dtos/user-permission.dto.d.ts +4 -0
  45. package/dtos/user.dto.d.ts +1 -2
  46. package/entities/index.d.ts +7 -3
  47. package/entities/pending-registration.entity.d.ts +17 -0
  48. package/entities/user-company-permission.entity.d.ts +1 -3
  49. package/entities/user-token.entity.d.ts +15 -0
  50. package/fesm/config/auth.constants.js +6 -2
  51. package/fesm/controllers/authentication.controller.js +368 -27
  52. package/fesm/controllers/branch.controller.js +45 -2
  53. package/fesm/controllers/company-selection.controller.js +28 -21
  54. package/fesm/controllers/company.controller.js +45 -2
  55. package/fesm/controllers/user-permission.controller.js +84 -156
  56. package/fesm/controllers/user.controller.js +214 -10
  57. package/fesm/docs/auth-swagger.config.js +14 -7
  58. package/fesm/dtos/authentication.dto.js +101 -39
  59. package/fesm/dtos/index.js +0 -1
  60. package/fesm/dtos/user-permission.dto.js +28 -0
  61. package/fesm/dtos/user.dto.js +20 -5
  62. package/fesm/entities/index.js +7 -1
  63. package/fesm/entities/pending-registration.entity.js +115 -0
  64. package/fesm/entities/user-company-permission.entity.js +3 -9
  65. package/fesm/entities/user-token.entity.js +113 -0
  66. package/fesm/interceptors/clear-token.interceptor.js +9 -22
  67. package/fesm/interceptors/set-token.interceptor.js +14 -54
  68. package/fesm/interfaces/auth-email-provider.interface.js +38 -0
  69. package/fesm/interfaces/authentication.interface.js +1 -1
  70. package/fesm/interfaces/index.js +2 -0
  71. package/fesm/interfaces/user-enricher.interface.js +26 -0
  72. package/fesm/modules/auth.module.js +67 -145
  73. package/fesm/services/auth-config.service.js +26 -28
  74. package/fesm/services/auth-datasource.provider.js +14 -24
  75. package/fesm/services/auth-email.service.js +405 -0
  76. package/fesm/services/authentication.service.js +297 -349
  77. package/fesm/services/branch.service.js +9 -4
  78. package/fesm/services/company-selection-session.service.js +1 -1
  79. package/fesm/services/index.js +1 -0
  80. package/fesm/services/user-permission.service.js +44 -74
  81. package/fesm/services/user.service.js +186 -36
  82. package/fesm/strategies/jwt.strategy.js +44 -44
  83. package/fesm/validators/password.validator.js +48 -0
  84. package/interceptors/clear-token.interceptor.d.ts +0 -1
  85. package/interceptors/set-token.interceptor.d.ts +1 -1
  86. package/interfaces/auth-email-provider.interface.d.ts +6 -0
  87. package/interfaces/auth-module-options.interface.d.ts +4 -1
  88. package/interfaces/authentication.interface.d.ts +13 -3
  89. package/interfaces/index.d.ts +2 -0
  90. package/interfaces/user-enricher.interface.d.ts +64 -0
  91. package/interfaces/user.interface.d.ts +1 -0
  92. package/modules/auth.module.d.ts +6 -3
  93. package/package.json +4 -4
  94. package/services/auth-config.service.d.ts +7 -8
  95. package/services/auth-datasource.provider.d.ts +2 -4
  96. package/services/auth-email.service.d.ts +54 -0
  97. package/services/authentication.service.d.ts +27 -16
  98. package/services/company-selection-session.service.d.ts +1 -1
  99. package/services/index.d.ts +1 -0
  100. package/services/user-permission.service.d.ts +6 -9
  101. package/services/user.service.d.ts +19 -3
  102. package/strategies/jwt.strategy.d.ts +4 -1
  103. package/validators/password.validator.d.ts +10 -0
  104. package/cjs/dtos/user-company-permission.dto.js +0 -110
  105. package/dtos/user-company-permission.dto.d.ts +0 -10
  106. package/fesm/dtos/user-company-permission.dto.js +0 -98
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "IsStrongPassword", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return IsStrongPassword;
9
+ }
10
+ });
11
+ const _classvalidator = require("class-validator");
12
+ function IsStrongPassword(options = {}, validationOptions) {
13
+ const { minLength = 8, maxLength = 128, requireUppercase = true, requireLowercase = true, requireNumber = true, requireSpecialChar = true } = options;
14
+ return function(object, propertyName) {
15
+ (0, _classvalidator.registerDecorator)({
16
+ name: 'isStrongPassword',
17
+ target: object.constructor,
18
+ propertyName: propertyName,
19
+ options: validationOptions,
20
+ validator: {
21
+ validate (value) {
22
+ if (typeof value !== 'string') return false;
23
+ const checks = [
24
+ value.length >= minLength,
25
+ value.length <= maxLength,
26
+ !requireUppercase || /[A-Z]/.test(value),
27
+ !requireLowercase || /[a-z]/.test(value),
28
+ !requireNumber || /[0-9]/.test(value),
29
+ !requireSpecialChar || /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~`]/.test(value)
30
+ ];
31
+ return checks.every(Boolean);
32
+ },
33
+ defaultMessage (args) {
34
+ const requirements = [];
35
+ if (minLength > 0) requirements.push(`at least ${minLength} characters`);
36
+ if (requireUppercase) requirements.push('one uppercase letter');
37
+ if (requireLowercase) requirements.push('one lowercase letter');
38
+ if (requireNumber) requirements.push('one number');
39
+ if (requireSpecialChar) requirements.push('one special character (!@#$%^&*...)');
40
+ return `Password must contain ${requirements.join(', ')}`;
41
+ }
42
+ }
43
+ });
44
+ };
45
+ }
@@ -1,4 +1,7 @@
1
1
  export declare const AUTH_MODULE_OPTIONS = "AUTH_MODULE_OPTIONS";
2
+ export declare const USER_ENRICHER = "USER_ENRICHER";
2
3
  export declare const BCRYPT_SALT_ROUNDS = 12;
4
+ export declare const DEFAULT_COOKIE_NAME = "fsn_refresh_token";
5
+ export declare const MAX_COOKIE_BYTES = 3500;
3
6
  export declare const SESSION_CACHE_PREFIX = "auth:session";
4
7
  export declare const TOKEN_REVOKED_PREFIX = "auth:revoked";
@@ -1,22 +1,28 @@
1
+ import { MessageResponseDto } from '@flusys/nestjs-shared/dtos';
1
2
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
2
3
  import { Request } from 'express';
3
- import { ChangePasswordDto, CompanySelectionResponseDto, LoginDto, LoginResponseDto, MeResponseDto, RefreshTokenDto, RegistrationDto, RegistrationResponseDto } from '../dtos/authentication.dto';
4
+ import { ChangePasswordDto, CompanySelectionResponseDto, ForgotPasswordDto, LoginDto, LoginResponseDto, LoginResponseRequiresEmailVerificationDto, MeResponseDto, RefreshTokenDto, RegistrationDto, RegistrationResponseDto, ResendVerificationDto, ResetPasswordDto, VerifyEmailDto } from '../dtos/authentication.dto';
4
5
  import { AuthConfigService } from '../services/auth-config.service';
6
+ import { AuthEmailService } from '../services/auth-email.service';
5
7
  import { AuthenticationService } from '../services/authentication.service';
6
8
  export declare class AuthenticationController {
7
9
  private readonly authService;
8
10
  private readonly authConfig?;
9
- constructor(authService: AuthenticationService, authConfig?: AuthConfigService);
10
- login(loginDto: LoginDto): Promise<LoginResponseDto | CompanySelectionResponseDto>;
11
- register(registrationDto: RegistrationDto): Promise<RegistrationResponseDto>;
11
+ private readonly authEmailService?;
12
+ constructor(authService: AuthenticationService, authConfig?: AuthConfigService, authEmailService?: AuthEmailService);
13
+ private buildAuthUrl;
14
+ private get emailService();
15
+ private get isEmailEnabled();
16
+ login(loginDto: LoginDto): Promise<LoginResponseDto | CompanySelectionResponseDto | LoginResponseRequiresEmailVerificationDto>;
17
+ register(req: Request, registrationDto: RegistrationDto): Promise<RegistrationResponseDto>;
12
18
  refreshToken(req: Request, refreshTokenDto: RefreshTokenDto): Promise<{
13
19
  accessToken: string;
14
20
  }>;
15
21
  getCurrentUser(user: ILoggedUserInfo): Promise<MeResponseDto>;
16
- logout(userId: string): Promise<{
17
- message: string;
18
- }>;
19
- changePassword(userId: string, dto: ChangePasswordDto): Promise<{
20
- message: string;
21
- }>;
22
+ logout(userId: string): Promise<MessageResponseDto>;
23
+ changePassword(userId: string, dto: ChangePasswordDto): Promise<MessageResponseDto>;
24
+ forgotPassword(req: Request, dto: ForgotPasswordDto): Promise<MessageResponseDto>;
25
+ resetPassword(dto: ResetPasswordDto): Promise<MessageResponseDto>;
26
+ resendVerification(req: Request, dto: ResendVerificationDto): Promise<MessageResponseDto>;
27
+ verifyEmail(dto: VerifyEmailDto): Promise<MessageResponseDto | RegistrationResponseDto>;
22
28
  }
@@ -6,9 +6,13 @@ export declare class CompanySelectionController {
6
6
  select(dto: SelectDto): Promise<LoginResponseDto>;
7
7
  switchCompany(userId: string, dto: SwitchCompanyDto): Promise<LoginResponseDto>;
8
8
  getUserCompanies(userId: string): Promise<{
9
- companies: import("..").Company[];
9
+ success: boolean;
10
+ message: string;
11
+ data: import("..").Company[];
10
12
  }>;
11
13
  getUserBranches(userId: string, companyId: string): Promise<{
12
- branches: import("..").CompanyBranch[];
14
+ success: boolean;
15
+ message: string;
16
+ data: import("..").CompanyBranch[];
13
17
  }>;
14
18
  }
@@ -1,8 +1,8 @@
1
- import { AssignUserCompanyDto, AssignUserBranchDto, UserCompaniesResponseDto, UserBranchesResponseDto } from '../dtos/user-permission.dto';
1
+ import { AssignUserBranchDto, AssignUserCompanyDto, UserBranchesResponseDto, UserCompaniesResponseDto } from '../dtos/user-permission.dto';
2
2
  import { UserPermissionService } from '../services/user-permission.service';
3
3
  export declare class UserPermissionController {
4
- private readonly userPermissionService;
5
- constructor(userPermissionService: UserPermissionService);
4
+ private readonly permissionService;
5
+ constructor(permissionService: UserPermissionService);
6
6
  assignUserCompany(dto: AssignUserCompanyDto): Promise<{
7
7
  success: boolean;
8
8
  message: string;
@@ -12,5 +12,6 @@ export declare class UserPermissionController {
12
12
  success: boolean;
13
13
  message: string;
14
14
  }>;
15
- getUserBranches(userId: string): Promise<UserBranchesResponseDto>;
15
+ getUserBranches(userId: string, companyId?: string): Promise<UserBranchesResponseDto>;
16
+ private processBatchPermissions;
16
17
  }
@@ -1,5 +1,6 @@
1
1
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
2
2
  import { CreateUserDto, UpdateUserDto, UserResponseDto } from '../dtos/user.dto';
3
+ import { IUser } from '../interfaces/user.interface';
3
4
  import { UserService } from '../services/user.service';
4
5
  declare const UserController_base: abstract new (service: UserService) => {
5
6
  service: UserService;
@@ -14,18 +15,50 @@ declare const UserController_base: abstract new (service: UserService) => {
14
15
  export declare class UserController extends UserController_base {
15
16
  service: UserService;
16
17
  constructor(service: UserService);
18
+ getProfileWithExtras(id: string, user: ILoggedUserInfo): Promise<{
19
+ success: boolean;
20
+ data: {
21
+ user: IUser;
22
+ extras?: import("..").IProfileExtras;
23
+ };
24
+ }>;
17
25
  verifyEmail(id: string): Promise<{
26
+ success: boolean;
18
27
  message: string;
19
28
  }>;
20
29
  verifyPhone(id: string): Promise<{
30
+ success: boolean;
21
31
  message: string;
22
32
  }>;
23
33
  updateStatus(id: string, isActive: boolean, user: ILoggedUserInfo): Promise<{
34
+ success: boolean;
24
35
  message: string;
25
36
  }>;
26
37
  profile(dto: UpdateUserDto, user: ILoggedUserInfo): Promise<{
38
+ success: boolean;
27
39
  message: string;
28
40
  data: string;
29
41
  }>;
42
+ getProfileSections(): Promise<{
43
+ success: boolean;
44
+ message: string;
45
+ data: import("..").IProfileSection[];
46
+ }>;
47
+ getProfileSectionData(id: string, sectionId: string, user: ILoggedUserInfo): Promise<{
48
+ success: boolean;
49
+ message: string;
50
+ data: import("..").IProfileSectionData;
51
+ }>;
52
+ updateProfileSection(id: string, sectionId: string, data: Record<string, any>, user: ILoggedUserInfo): Promise<{
53
+ success: boolean;
54
+ message: string;
55
+ }>;
56
+ getProfileCompletion(id: string, user: ILoggedUserInfo): Promise<{
57
+ success: boolean;
58
+ message: string;
59
+ data: {
60
+ completionPercentage: number;
61
+ };
62
+ }>;
30
63
  }
31
64
  export {};
@@ -51,14 +51,12 @@ export declare class BranchSelectionInfoDto {
51
51
  id: string;
52
52
  name: string;
53
53
  slug: string;
54
- isActive: boolean;
55
54
  logoId?: string | null;
56
55
  }
57
56
  export declare class CompanyWithBranchesDto {
58
57
  id: string;
59
58
  name: string;
60
59
  slug: string;
61
- isActive: boolean;
62
60
  logoId?: string | null;
63
61
  branches: BranchSelectionInfoDto[];
64
62
  }
@@ -68,15 +66,14 @@ export declare class LoginResponseDto {
68
66
  user: UserInfoDto;
69
67
  company?: CompanyInfoDto;
70
68
  branch?: BranchInfoDto;
71
- companyFeatureEnabled?: boolean;
72
69
  }
73
70
  export declare class RegistrationResponseDto {
74
- accessToken: string;
75
- refreshToken: string;
71
+ accessToken?: string;
72
+ refreshToken?: string;
76
73
  user: UserInfoDto;
77
74
  company?: CompanyInfoDto;
78
75
  branch?: BranchInfoDto;
79
- companyFeatureEnabled: boolean;
76
+ requiresEmailVerification?: boolean;
80
77
  }
81
78
  export declare class MeResponseDto {
82
79
  user: UserInfoDto;
@@ -90,3 +87,20 @@ export declare class CompanySelectionResponseDto {
90
87
  user: UserInfoDto;
91
88
  companies: CompanyWithBranchesDto[];
92
89
  }
90
+ export declare class LoginResponseRequiresEmailVerificationDto {
91
+ requiresEmailVerification: true;
92
+ email: string;
93
+ message: string;
94
+ }
95
+ export declare class ForgotPasswordDto {
96
+ email: string;
97
+ }
98
+ export declare class ResetPasswordDto {
99
+ token: string;
100
+ newPassword: string;
101
+ }
102
+ export declare class VerifyEmailDto {
103
+ token: string;
104
+ }
105
+ export declare class ResendVerificationDto extends ForgotPasswordDto {
106
+ }
@@ -1,5 +1,4 @@
1
1
  export declare class CreateCompanyBranchDto {
2
- [key: string]: unknown;
3
2
  name: string;
4
3
  slug: string;
5
4
  companyId: string;
@@ -1,5 +1,4 @@
1
1
  export declare class CreateCompanyDto {
2
- [key: string]: unknown;
3
2
  name: string;
4
3
  slug: string;
5
4
  logoId?: string;
package/dtos/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from './authentication.dto';
2
2
  export * from './company-branch.dto';
3
3
  export * from './company.dto';
4
- export * from './user-company-permission.dto';
5
4
  export * from './user.dto';
6
5
  export * from './user-permission.dto';
@@ -26,8 +26,12 @@ export declare class UserBranchPermissionDto {
26
26
  companyId: string;
27
27
  }
28
28
  export declare class UserCompaniesResponseDto {
29
+ success: boolean;
30
+ message: string;
29
31
  data: UserCompanyPermissionDto[];
30
32
  }
31
33
  export declare class UserBranchesResponseDto {
34
+ success: boolean;
35
+ message: string;
32
36
  data: UserBranchPermissionDto[];
33
37
  }
@@ -1,5 +1,4 @@
1
1
  export declare class CreateUserDto {
2
- [key: string]: unknown;
3
2
  name: string;
4
3
  phone?: string;
5
4
  email: string;
@@ -16,6 +15,7 @@ export declare class UpdateUserDto {
16
15
  phone?: string;
17
16
  email?: string;
18
17
  password?: string;
18
+ oldPassword?: string;
19
19
  profilePictureId?: string;
20
20
  isActive?: boolean;
21
21
  emailVerified?: boolean;
@@ -23,7 +23,6 @@ export declare class UpdateUserDto {
23
23
  additionalFields?: Record<string, any>;
24
24
  }
25
25
  export declare class UserResponseDto {
26
- [key: string]: unknown;
27
26
  id: string;
28
27
  name: string;
29
28
  phone?: string | null;
@@ -1,12 +1,16 @@
1
1
  export * from './company-branch.entity';
2
2
  export * from './company.entity';
3
+ export * from './pending-registration.entity';
3
4
  export { PermissionType, UserCompanyPermission } from './user-company-permission.entity';
4
5
  export * from './user.entity';
6
+ export * from './user-token.entity';
5
7
  import { CompanyBranch } from './company-branch.entity';
6
8
  import { Company } from './company.entity';
9
+ import { PendingRegistration } from './pending-registration.entity';
7
10
  import { UserCompanyPermission } from './user-company-permission.entity';
8
11
  import { User } from './user.entity';
9
- export declare const CoreEntities: (typeof User)[];
12
+ import { UserToken } from './user-token.entity';
13
+ export declare const CoreEntities: (typeof PendingRegistration | typeof UserToken | typeof User)[];
10
14
  export declare const CompanyEntities: (typeof Company | typeof CompanyBranch | typeof UserCompanyPermission)[];
11
- export declare const AllEntities: (typeof Company | typeof CompanyBranch | typeof User | typeof UserCompanyPermission)[];
12
- export declare function getEntitiesByConfig(enableCompanyFeature: boolean): (typeof Company | typeof CompanyBranch | typeof User | typeof UserCompanyPermission)[];
15
+ export declare const AllEntities: (typeof PendingRegistration | typeof UserToken | typeof User | typeof Company | typeof CompanyBranch | typeof UserCompanyPermission)[];
16
+ export declare function getEntitiesByConfig(enableCompanyFeature: boolean): (typeof PendingRegistration | typeof UserToken | typeof User | typeof Company | typeof CompanyBranch | typeof UserCompanyPermission)[];
@@ -0,0 +1,17 @@
1
+ export declare class PendingRegistration {
2
+ id: string;
3
+ email: string;
4
+ name: string | null;
5
+ phone: string | null;
6
+ passwordHash: string;
7
+ token: string;
8
+ expiresAt: Date;
9
+ companyData: {
10
+ companySlug?: string;
11
+ branchSlug?: string;
12
+ newCompanyName?: string;
13
+ newCompanyPhone?: string;
14
+ newCompanyAddress?: string;
15
+ } | null;
16
+ createdAt: Date;
17
+ }
@@ -7,7 +7,7 @@ export declare class UserCompanyPermission {
7
7
  id: string;
8
8
  userId: string;
9
9
  user?: User;
10
- permissionType: PermissionType;
10
+ permissionType: string;
11
11
  targetId: string;
12
12
  metadata?: Record<string, any>;
13
13
  isActive: boolean;
@@ -15,6 +15,4 @@ export declare class UserCompanyPermission {
15
15
  branch?: CompanyBranch;
16
16
  createdAt: Date;
17
17
  updatedAt: Date;
18
- isCompanyPermission(): boolean;
19
- isBranchPermission(): boolean;
20
18
  }
@@ -0,0 +1,15 @@
1
+ export declare enum TokenType {
2
+ PASSWORD_RESET = "password_reset",
3
+ EMAIL_VERIFICATION = "email_verification",
4
+ EMAIL_CHANGE = "email_change"
5
+ }
6
+ export declare class UserToken {
7
+ id: string;
8
+ userId: string;
9
+ type: TokenType;
10
+ token: string;
11
+ expiresAt: Date;
12
+ usedAt: Date | null;
13
+ metadata: string | null;
14
+ createdAt: Date;
15
+ }
@@ -1,7 +1,11 @@
1
1
  // Injection Tokens
2
2
  export const AUTH_MODULE_OPTIONS = 'AUTH_MODULE_OPTIONS';
3
- // Security Configuration
4
- /** Bcrypt salt rounds (12 = ~250ms hashing time) */ export const BCRYPT_SALT_ROUNDS = 12;
3
+ export const USER_ENRICHER = 'USER_ENRICHER';
4
+ // Security
5
+ export const BCRYPT_SALT_ROUNDS = 12;
6
+ // Cookie
7
+ export const DEFAULT_COOKIE_NAME = 'fsn_refresh_token';
8
+ export const MAX_COOKIE_BYTES = 3500;
5
9
  // Cache Key Prefixes
6
10
  export const SESSION_CACHE_PREFIX = 'auth:session';
7
11
  export const TOKEN_REVOKED_PREFIX = 'auth:revoked';