diff --git a/src/app/service/auth.service.ts b/src/app/service/auth.service.ts index 5181a8f..6c926df 100644 --- a/src/app/service/auth.service.ts +++ b/src/app/service/auth.service.ts @@ -16,8 +16,9 @@ import { environment } from '../../environments/environment'; export class AuthGuard implements CanActivate { constructor(private router: Router) { }; - canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { + async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise { const pb = new PocketBase(environment.POCKETBASE); + await pb.collection('users').authRefresh().catch(() => this.router.navigate([''])); if (pb.authStore.isValid) { return true; diff --git a/src/environments/environment.production.ts b/src/environments/environment.production.ts index 5a76b29..9928ed1 100644 --- a/src/environments/environment.production.ts +++ b/src/environments/environment.production.ts @@ -1,3 +1,3 @@ export const environment = { - POCKETBASE: 'http://pocketbase-oowogg0wo4gw04sss44gos4o.192.168.178.105.sslip.io/', + POCKETBASE: 'http://pocketbase-prod-jktime-oowogg0wo4gw04sss44gos4o.192.168.178.105.sslip.io/', };