mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Migrate AuthContext
This commit is contained in:
@@ -72,31 +72,6 @@ export interface LoginRequest {
|
||||
password: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login response from the API
|
||||
*/
|
||||
export interface LoginResponse {
|
||||
user: User;
|
||||
sessionId: string;
|
||||
expiresAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type guard to check if a value is a valid LoginResponse
|
||||
*/
|
||||
export function isLoginResponse(value: unknown): value is LoginResponse {
|
||||
return (
|
||||
typeof value === 'object' &&
|
||||
value !== null &&
|
||||
'user' in value &&
|
||||
isUser((value as LoginResponse).user) &&
|
||||
'sessionId' in value &&
|
||||
typeof (value as LoginResponse).sessionId === 'string' &&
|
||||
'expiresAt' in value &&
|
||||
typeof (value as LoginResponse).expiresAt === 'string'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* API call options extending the standard RequestInit
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user