wip
This commit is contained in:
27
apps/website/lib/auth/AuthService.ts
Normal file
27
apps/website/lib/auth/AuthService.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export interface AuthUser {
|
||||
id: string;
|
||||
displayName: string;
|
||||
iracingCustomerId?: string;
|
||||
primaryDriverId?: string;
|
||||
avatarUrl?: string;
|
||||
}
|
||||
|
||||
export interface AuthSession {
|
||||
user: AuthUser;
|
||||
issuedAt: number;
|
||||
expiresAt: number;
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface AuthService {
|
||||
getCurrentSession(): Promise<AuthSession | null>;
|
||||
startIracingAuthRedirect(
|
||||
returnTo?: string,
|
||||
): Promise<{ redirectUrl: string; state: string }>;
|
||||
loginWithIracingCallback(params: {
|
||||
code: string;
|
||||
state: string;
|
||||
returnTo?: string;
|
||||
}): Promise<AuthSession>;
|
||||
logout(): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user