import { APIClient } from "./ApiClient"; export class AuthApi { /** * Start OpenID login */ static async StartOpenIDLogin(): Promise<{ url: string }> { return ( await APIClient.exec({ uri: "/auth/start_oidc", method: "GET", }) ).data; } /** * Finish OpenID login */ static async FinishOpenIDLogin(code: string, state: string): Promise { await APIClient.exec({ uri: "/auth/finish_oidc", method: "POST", jsonData: { code: code, state: state }, }); window.location.href = "/"; } /** * Sign out */ static async SignOut(): Promise { await APIClient.exec({ uri: "/auth/sign_out", method: "GET", }); window.location.href = "/"; } }