diff --git a/app/src/routes/__layout.svelte b/app/src/routes/__layout.svelte
index 068e441..a471b5a 100644
--- a/app/src/routes/__layout.svelte
+++ b/app/src/routes/__layout.svelte
@@ -1,8 +1,12 @@
@@ -191,7 +195,7 @@
"items-center",
"flex-col",
"bg-orange-600",
- "text-white"
+ "text-white",
)}
>
© RaviAnand M, 2021
diff --git a/package.json b/package.json
index f3f98a2..8be4676 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
],
"scripts": {
"build": "rollup --config",
- "dev": "rollup --watch",
+ "dev": "rollup --config --watch",
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --write --plugin-search-dir=. ."
diff --git a/src/client/signIn.ts b/src/client/signIn.ts
index 1844100..7cc3ba3 100644
--- a/src/client/signIn.ts
+++ b/src/client/signIn.ts
@@ -1,5 +1,5 @@
-import { goto } from "@sveltejs/kit/assets/runtime/app/navigation";
-import { page } from "@sveltejs/kit/assets/runtime/app/stores";
+/* import { goto } from "@sveltejs/kit/assets/runtime/app/navigation";
+import { page } from "@sveltejs/kit/assets/runtime/app/stores"; */
import type { Page } from "@sveltejs/kit";
interface SignInConfig {
@@ -24,7 +24,7 @@ export async function signIn(provider: string, data?: any, config?: SignInConfig
redirectUrl = config.redirectUrl;
} else {
let $val: Page | undefined;
- page.subscribe(($) => ($val = $))();
+ /* page.subscribe(($) => ($val = $))(); */
if ($val) {
redirectUrl = `${$val.host}${$val.path}?${$val.query}`;
}
@@ -36,5 +36,5 @@ export async function signIn(provider: string, data?: any, config?: SignInConfig
const query = new URLSearchParams(queryData);
const path = `/api/auth/login/${provider}?${query}`;
- return await goto(path);
+ return path; // await goto(path);
}
diff --git a/src/client/signOut.ts b/src/client/signOut.ts
index 564ab69..a6d91cf 100644
--- a/src/client/signOut.ts
+++ b/src/client/signOut.ts
@@ -1,12 +1,15 @@
-import { session as session$ } from "$app/stores";
+/* import { session as session$ } from "$app/stores"; */
export async function signOut() {
- const res = await fetch("/api/auth/signout", { method: "POST" });
+ let res = await fetch("/api/auth/signout", { method: "POST" });
const { signout } = await res.json();
- fetch("/api/auth/session")
- .then((res) => res.json())
- .then(session$.set);
+ if (!signout) {
+ throw new Error("Sign out not successful!");
+ }
- return signout === true;
+ res = await fetch("/api/auth/session");
+ const session = await res.json();
+
+ return session;
}