74 lines
2.6 KiB
TypeScript
74 lines
2.6 KiB
TypeScript
/* istanbul ignore file */
|
|
/* tslint:disable */
|
|
/* eslint-disable */
|
|
import type { Auth } from '../models/Auth';
|
|
import type { CreateAuth } from '../models/CreateAuth';
|
|
import type { HandleLogout } from '../models/HandleLogout';
|
|
import type { IllegalJWTError } from '../models/IllegalJWTError';
|
|
import type { InvalidCredentialsError } from '../models/InvalidCredentialsError';
|
|
import type { JwtNotProvidedError } from '../models/JwtNotProvidedError';
|
|
import type { Logout } from '../models/Logout';
|
|
import type { PasswordNeededError } from '../models/PasswordNeededError';
|
|
import type { RefreshAuth } from '../models/RefreshAuth';
|
|
import type { RefreshTokenCountInvalidError } from '../models/RefreshTokenCountInvalidError';
|
|
import type { UsernameOrEmailNeededError } from '../models/UsernameOrEmailNeededError';
|
|
import type { UserNotFoundError } from '../models/UserNotFoundError';
|
|
import { request as __request } from '../core/request';
|
|
|
|
export class AuthService {
|
|
|
|
/**
|
|
* Login
|
|
* Create a new access token object
|
|
* @param requestBody CreateAuth
|
|
* @result any
|
|
* @throws ApiError
|
|
*/
|
|
public static async authControllerLogin(
|
|
requestBody?: CreateAuth,
|
|
): Promise<(Auth | InvalidCredentialsError | UserNotFoundError | UsernameOrEmailNeededError | PasswordNeededError | InvalidCredentialsError)> {
|
|
const result = await __request({
|
|
method: 'POST',
|
|
path: `/api/auth/login`,
|
|
body: requestBody,
|
|
});
|
|
return result.body;
|
|
}
|
|
|
|
/**
|
|
* Logout
|
|
* Create a new access token object
|
|
* @param requestBody HandleLogout
|
|
* @result any
|
|
* @throws ApiError
|
|
*/
|
|
public static async authControllerLogout(
|
|
requestBody?: HandleLogout,
|
|
): Promise<(Logout | InvalidCredentialsError | UserNotFoundError | UsernameOrEmailNeededError | PasswordNeededError | InvalidCredentialsError)> {
|
|
const result = await __request({
|
|
method: 'POST',
|
|
path: `/api/auth/logout`,
|
|
body: requestBody,
|
|
});
|
|
return result.body;
|
|
}
|
|
|
|
/**
|
|
* Refresh
|
|
* refresh a access token
|
|
* @param requestBody RefreshAuth
|
|
* @result any
|
|
* @throws ApiError
|
|
*/
|
|
public static async authControllerRefresh(
|
|
requestBody?: RefreshAuth,
|
|
): Promise<(Auth | JwtNotProvidedError | IllegalJWTError | UserNotFoundError | RefreshTokenCountInvalidError)> {
|
|
const result = await __request({
|
|
method: 'POST',
|
|
path: `/api/auth/refresh`,
|
|
body: requestBody,
|
|
});
|
|
return result.body;
|
|
}
|
|
|
|
} |