ghorsington 4 лет назад
Родитель
Сommit
50ec57aa4b
2 измененных файлов с 3 добавлено и 0 удалено
  1. 1 0
      web/src/routes/_layout.svelte
  2. 2 0
      web/src/routes/login/check.ts

+ 1 - 0
web/src/routes/_layout.svelte

@@ -11,6 +11,7 @@
   ) {
     const authResult = await this.fetch("/login/check");
     const result = (await authResult.json()) as AuthInfo;
+    console.log(result);
     if (path.startsWith("/login/")) {
       if (result.loggedIn) {
         return this.redirect(302, "/");

+ 2 - 0
web/src/routes/login/check.ts

@@ -8,6 +8,8 @@ export interface AuthInfo {
 
 type CheckResult = Promise<ExpressResponse<CheckResult>>;
 export const get = async (req: ExpressRequest, res: ExpressResponse): CheckResult => {
+    console.log(req.session);
+    console.log(req.session?.userId);
     if (!req.session?.userId) {
         return res.json({
             loggedIn: false,