Enhance auth-guard service for new API

This commit is contained in:
Rene Vergara 2023-05-08 12:02:31 -05:00
parent a0291fb05e
commit 040fc22e69
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -3,12 +3,10 @@ import { CanActivate, Router, RouterStateSnapshot, ActivatedRouteSnapshot } from
import {HttpClient, HttpParams} from '@angular/common/http'; import {HttpClient, HttpParams} from '@angular/common/http';
import { UserService } from './user.service'; import { UserService } from './user.service';
import { Subscription, Observable } from 'rxjs'; import { Subscription, Observable } from 'rxjs';
import { Owner } from './owner.model';
@Injectable() @Injectable()
export class AuthGuardService implements CanActivate { export class AuthGuardService implements CanActivate {
private UserSub: Subscription = new Subscription();
private addr = ''; private addr = '';
private paid = false; private paid = false;
private paidUpdate: Observable<boolean>; private paidUpdate: Observable<boolean>;
@ -32,7 +30,7 @@ export class AuthGuardService implements CanActivate {
this.userService.uZaddrUpdate. this.userService.uZaddrUpdate.
subscribe((addr) => { subscribe((addr) => {
if (addr != null) { if (addr != null) {
console.log(addr); //console.log(addr);
this.addr = addr; this.addr = addr;
} else { } else {
console.log("No record for that token"); console.log("No record for that token");