clean routes
This commit is contained in:
@@ -2,8 +2,6 @@ import { BaseApiClient } from '../base/BaseApiClient';
|
||||
import { AuthSessionDTO } from '../../types/generated/AuthSessionDTO';
|
||||
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';
|
||||
@@ -36,32 +34,6 @@ export class AuthApiClient extends BaseApiClient {
|
||||
return this.post<void>('/auth/logout', {});
|
||||
}
|
||||
|
||||
/** Start iRacing auth redirect */
|
||||
startIracingAuthRedirect(returnTo?: string): Promise<IracingAuthRedirectResultDTO> {
|
||||
const query = returnTo ? `?returnTo=${encodeURIComponent(returnTo)}` : '';
|
||||
return this.get<IracingAuthRedirectResultDTO>(`/auth/iracing/start${query}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience: build iRacing auth start URL.
|
||||
* Used by AuthService for view-layer navigation.
|
||||
*/
|
||||
getIracingAuthUrl(returnTo?: string): string {
|
||||
const query = returnTo ? `?returnTo=${encodeURIComponent(returnTo)}` : '';
|
||||
return `${this.baseUrl}/auth/iracing/start${query}`;
|
||||
}
|
||||
|
||||
/** Login with iRacing callback */
|
||||
loginWithIracingCallback(params: LoginWithIracingCallbackParamsDTO): Promise<AuthSessionDTO> {
|
||||
const query = new URLSearchParams();
|
||||
query.append('code', params.code);
|
||||
query.append('state', params.state);
|
||||
if (params.returnTo) {
|
||||
query.append('returnTo', params.returnTo);
|
||||
}
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user