auth
This commit is contained in:
@@ -4,6 +4,9 @@ import { LoginParamsDTO } from '../../types/generated/LoginParamsDTO';
|
||||
import { SignupParamsDTO } from '../../types/generated/SignupParamsDTO';
|
||||
import { LoginWithIracingCallbackParamsDTO } from '../../types/generated/LoginWithIracingCallbackParamsDTO';
|
||||
import { IracingAuthRedirectResultDTO } from '../../types/generated/IracingAuthRedirectResultDTO';
|
||||
import { ForgotPasswordDTO } from '../../types/generated/ForgotPasswordDTO';
|
||||
import { ResetPasswordDTO } from '../../types/generated/ResetPasswordDTO';
|
||||
import { DemoLoginDTO } from '../../types/generated/DemoLoginDTO';
|
||||
|
||||
/**
|
||||
* Auth API Client
|
||||
@@ -58,4 +61,19 @@ export class AuthApiClient extends BaseApiClient {
|
||||
}
|
||||
return this.get<AuthSessionDTO>(`/auth/iracing/callback?${query.toString()}`);
|
||||
}
|
||||
|
||||
/** Forgot password - send reset link */
|
||||
forgotPassword(params: ForgotPasswordDTO): Promise<{ message: string; magicLink?: string }> {
|
||||
return this.post<{ message: string; magicLink?: string }>('/auth/forgot-password', params);
|
||||
}
|
||||
|
||||
/** Reset password with token */
|
||||
resetPassword(params: ResetPasswordDTO): Promise<{ message: string }> {
|
||||
return this.post<{ message: string }>('/auth/reset-password', params);
|
||||
}
|
||||
|
||||
/** Demo login (development only) */
|
||||
demoLogin(params: DemoLoginDTO): Promise<AuthSessionDTO> {
|
||||
return this.post<AuthSessionDTO>('/auth/demo-login', params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user