all work till 15 jan

This commit is contained in:
vivekm2 2025-01-15 18:26:54 +05:30
parent 81e5b8cf52
commit 017919aa4b
249 changed files with 127261 additions and 45869 deletions

30
src/app/dbauth.guard.ts Normal file
View file

@ -0,0 +1,30 @@
import { Injectable } from "@angular/core";
import {
CanActivate,
ActivatedRouteSnapshot,
RouterStateSnapshot,
} from "@angular/router";
import { Observable } from "rxjs/Observable";
import { Router } from "@angular/router";
@Injectable()
export class DbauthGuard implements CanActivate {
constructor(private router: Router) {}
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean> | Promise<boolean> | boolean {
if (
window.location.origin.match(/nipponsecura.in/g) != null &&
state.url == "/add_newDevice"
) {
this.router.navigateByUrl("add_newDevice2");
} else if (
window.location.origin.match(/nipponsecura.in/g) != null &&
state.url == "/editDevice"
) {
this.router.navigateByUrl("db_editDevice");
}
return true;
}
}