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; } }