Spaces:
Running

File size: 909 Bytes
f287aeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
export interface PreLoginRequest {
  email: string;
  password: string;
}

export interface FarmInfo {
  id: string;
  name: string;
}

export interface BackendAuthUser {
  id: string;
  email: string;
  role?: string;
  farmId?: string;
  modules?: string[];
  name?: string;
  phone?: string;
}

export interface AuthLoginResult {
  token?: string;
  refreshToken?: string;
  expiresIn?: number;
  refreshExpiresIn?: number;
  user?: BackendAuthUser;
  requiresOTP: boolean;
  sessionToken?: string;
  message?: string;
  accountLocked?: boolean;
}

export interface PreLoginResponse {
  requiresFarmSelection: boolean;
  farms?: FarmInfo[];
  loginResult?: AuthLoginResult;
}

export interface LoginRequest extends PreLoginRequest {
  farmId: string;
}

export interface AuthApiErrorPayload {
  statusCode?: number;
  message?: string | string[];
  error?: string;
  timestamp?: string;
  path?: string;
}