27 lines
599 B
TypeScript
27 lines
599 B
TypeScript
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>;
|
|
} |