Merge branch 'Dan6erbond:main' into main

This commit is contained in:
Leo Voon 2022-07-23 01:28:19 +08:00 committed by GitHub
commit ff96c17a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,4 @@
function mergePath(basePaths: (string | null)[], path: string) {
export function mergePath(basePaths: (string | null)[], path: string) {
if (path.startsWith("/")) {
path = path.slice(1);
}

View File

@ -2,6 +2,7 @@
import { page } from "@sveltejs/kit/assets/runtime/app/stores"; */
import type { LoadInput } from "@sveltejs/kit";
import type { ClientRequestConfig } from "./types";
import { mergePath } from "./helpers";
interface SignInConfig extends ClientRequestConfig {
redirectUrl?: string;

View File

@ -1,6 +1,7 @@
/* import { session as session$ } from "$app/stores"; */
import type { ClientRequestConfig } from "./types";
import { mergePath } from "./helpers";
export async function signOut(config?: ClientRequestConfig) {
let res = await fetch(mergePath(["/api/auth", config?.basePath ?? null], "signout"), {