initial commit
This commit is contained in:
29
packages/auth/src/index.ts
Normal file
29
packages/auth/src/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export enum UserRole {
|
||||
USER = 'USER',
|
||||
SUPPORT = 'SUPPORT',
|
||||
MODERATOR = 'MODERATOR',
|
||||
ADMIN = 'ADMIN',
|
||||
SUPER_ADMIN = 'SUPER_ADMIN',
|
||||
}
|
||||
|
||||
export interface AuthenticatedUser {
|
||||
id: string;
|
||||
email: string;
|
||||
username: string;
|
||||
roles: UserRole[];
|
||||
}
|
||||
|
||||
export interface SessionContext {
|
||||
user: AuthenticatedUser;
|
||||
sessionId: string;
|
||||
issuedAt: Date;
|
||||
expiresAt: Date;
|
||||
}
|
||||
|
||||
export interface AuthTokenPayload {
|
||||
sub: string;
|
||||
sessionId: string;
|
||||
roles: UserRole[];
|
||||
iat?: number;
|
||||
exp?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user