forked from uw-ssec/respondent-driven-sampling
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.ts
More file actions
33 lines (27 loc) · 663 Bytes
/
auth.ts
File metadata and controls
33 lines (27 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Ability } from '@/utils/roleDefinitions';
import { Request } from 'express';
import { JwtPayload } from 'jsonwebtoken';
export interface AuthenticatedRequest extends Request {
user?: {
employeeId: string;
role: string;
firstName: string;
};
authorization?: Ability;
}
export interface JWTPayload extends JwtPayload {
employeeId: string;
role: string;
}
export interface OTPRequest {
phone: string;
email: string;
}
export interface VerifyOTPRequest extends OTPRequest {
code: string;
}
export interface SignupRequest extends VerifyOTPRequest {
name: string;
role: string;
}
export interface LoginRequest extends VerifyOTPRequest {}