mirror of
https://github.com/makeplane/plane.git
synced 2026-01-29 01:38:53 -06:00
* [WEB-1657] dev: admin application code structuring. * chore: update mobx-react-lite import to mobx-react.
23 lines
506 B
TypeScript
23 lines
506 B
TypeScript
// helpers
|
|
import { API_BASE_URL } from "helpers/common.helper";
|
|
// services
|
|
import { APIService } from "@/services/api.service";
|
|
|
|
type TCsrfTokenResponse = {
|
|
csrf_token: string;
|
|
};
|
|
|
|
export class AuthService extends APIService {
|
|
constructor() {
|
|
super(API_BASE_URL);
|
|
}
|
|
|
|
async requestCSRFToken(): Promise<TCsrfTokenResponse> {
|
|
return this.get<TCsrfTokenResponse>("/auth/get-csrf-token/")
|
|
.then((response) => response.data)
|
|
.catch((error) => {
|
|
throw error;
|
|
});
|
|
}
|
|
}
|