mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 14:25:47 +00:00
24 lines
554 B
TypeScript
24 lines
554 B
TypeScript
import axios from 'axios';
|
|
import { httpClient } from '@/services/http/client';
|
|
import { BaseApiResponse, LogoutResponse } from '@/types/api/api-general';
|
|
|
|
export class AuthApiService {
|
|
async logout() {
|
|
try {
|
|
const logoutRes = await httpClient<LogoutResponse>(`/sso/logout`, {
|
|
method: 'POST',
|
|
});
|
|
|
|
return logoutRes;
|
|
} catch (error) {
|
|
if (axios.isAxiosError<BaseApiResponse>(error)) {
|
|
return error.response?.data;
|
|
}
|
|
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
export const AuthApi = new AuthApiService();
|