From d3b9da0a8cf1466bb18f3d9090ea5485a9796efe Mon Sep 17 00:00:00 2001 From: jgerstbe Date: Wed, 21 Apr 2021 23:08:05 +0200 Subject: [PATCH] [U] fix redirect to login --- src/app/api/supabase/supa.service.ts | 2 +- src/app/authguard.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/api/supabase/supa.service.ts b/src/app/api/supabase/supa.service.ts index 08c831e..3b9061b 100644 --- a/src/app/api/supabase/supa.service.ts +++ b/src/app/api/supabase/supa.service.ts @@ -21,7 +21,7 @@ export class SupaService { } async getUserModel() { - const user = await this.client.auth.user(); + const user = this.client.auth.user(); if (user) { console.log('user', user); this.supabaseUserModel = user; diff --git a/src/app/authguard.service.ts b/src/app/authguard.service.ts index 3d55d2a..813413f 100644 --- a/src/app/authguard.service.ts +++ b/src/app/authguard.service.ts @@ -15,10 +15,10 @@ export class AuthGuard implements CanActivate { /* Try to auth with the server. If authed resolve to true, else resolve to false */ const user = this.supa.client.auth.user(); - console.warn('authguard: user', user); if (user) { return true; } + this.router.navigateByUrl('/login'); return false; } }