* fix: refactoring * fix: site ssr implementation * chore: fixed auto reload on file change in sites * chore: updated constant imports and globalised powerBy component * chore: resolved lint and updated the env --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
35 lines
1 KiB
TypeScript
35 lines
1 KiB
TypeScript
import { API_BASE_URL } from "@plane/constants";
|
|
// services
|
|
import { APIService } from "@/services/api.service";
|
|
// types
|
|
import { ICsrfTokenData, IEmailCheckData, IEmailCheckResponse } from "@/types/auth";
|
|
|
|
export class AuthService extends APIService {
|
|
constructor() {
|
|
super(API_BASE_URL);
|
|
}
|
|
|
|
async requestCSRFToken(): Promise<ICsrfTokenData> {
|
|
return this.get("/auth/get-csrf-token/")
|
|
.then((response) => response.data)
|
|
.catch((error) => {
|
|
throw error;
|
|
});
|
|
}
|
|
|
|
async emailCheck(data: IEmailCheckData): Promise<IEmailCheckResponse> {
|
|
return this.post("/auth/spaces/email-check/", data, { headers: {} })
|
|
.then((response) => response?.data)
|
|
.catch((error) => {
|
|
throw error?.response?.data;
|
|
});
|
|
}
|
|
|
|
async generateUniqueCode(data: { email: string }): Promise<void> {
|
|
return this.post("/auth/spaces/magic-generate/", data, { headers: {} })
|
|
.then((response) => response?.data)
|
|
.catch((error) => {
|
|
throw error?.response?.data;
|
|
});
|
|
}
|
|
}
|