[U] fix redirect to login

This commit is contained in:
Jan 2021-04-21 23:08:05 +02:00
parent e1875b27fd
commit d3b9da0a8c
2 changed files with 2 additions and 2 deletions

View file

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

View file

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