From 1a1fefc237e2150519fc3864ca3769b120587f99 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Tue, 25 Nov 2025 09:19:58 +0700 Subject: [PATCH] chore: create AuthApiService --- src/services/api/auth.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/services/api/auth.ts b/src/services/api/auth.ts index e69de29b..f5319435 100644 --- a/src/services/api/auth.ts +++ b/src/services/api/auth.ts @@ -0,0 +1,23 @@ +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(`/sso/logout`, { + method: 'POST', + }); + + return logoutRes; + } catch (error) { + if (axios.isAxiosError(error)) { + return error.response?.data; + } + + return undefined; + } + } +} + +export const AuthApi = new AuthApiService();