tango-app-ui-auth 3.0.6 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,40 @@
1
1
  import { Injectable } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "../services/auth.service";
4
+ import * as i2 from "tango-app-ui-shared";
5
+ import * as i3 from "@angular/router";
4
6
  export class AuthGuard {
5
7
  authService;
6
- constructor(authService) {
8
+ gs;
9
+ route;
10
+ authlocalStorageToken;
11
+ constructor(authService, gs, route) {
7
12
  this.authService = authService;
13
+ this.gs = gs;
14
+ this.route = route;
15
+ this.gs.environment.subscribe((env) => {
16
+ if (env) {
17
+ this.authlocalStorageToken = `${env.appVersion}-${env.USERDATA_KEY}`;
18
+ }
19
+ });
8
20
  }
9
21
  canActivate(route, state) {
10
- const currentUser = localStorage.getItem('isLoggedIn');
11
- if (currentUser === 'true') {
12
- // logged in so return true
22
+ // const currentUser = localStorage.getItem('isLoggedIn');
23
+ const currentUser = localStorage.getItem(this.authlocalStorageToken);
24
+ if (currentUser) {
25
+ // this.route.navigate(['/manage/brands']);
13
26
  return true;
14
27
  }
15
- // not logged in so redirect to login page with the return url
16
- this.authService.logout();
17
- return false;
28
+ else {
29
+ this.route.navigate(['/auth/login']);
30
+ return false;
31
+ }
18
32
  }
19
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, deps: [{ token: i1.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
33
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, deps: [{ token: i1.AuthService }, { token: i2.GlobalStateService }, { token: i3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
20
34
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, providedIn: 'root' });
21
35
  }
22
36
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, decorators: [{
23
37
  type: Injectable,
24
38
  args: [{ providedIn: 'root' }]
25
- }], ctorParameters: () => [{ type: i1.AuthService }] });
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5ndWFyZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3RhbmdvLWF1dGgvc3JjL2xpYi9ndWFyZHMvYXV0aC5ndWFyZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7QUFLM0MsTUFBTSxPQUFPLFNBQVM7SUFDQTtJQUFwQixZQUFvQixXQUF3QjtRQUF4QixnQkFBVyxHQUFYLFdBQVcsQ0FBYTtJQUFHLENBQUM7SUFFaEQsV0FBVyxDQUFDLEtBQTZCLEVBQUUsS0FBMEI7UUFDbkUsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBQztRQUN2RCxJQUFJLFdBQVcsS0FBSyxNQUFNLEVBQUU7WUFDMUIsMkJBQTJCO1lBQzNCLE9BQU8sSUFBSSxDQUFDO1NBQ2I7UUFFRCw4REFBOEQ7UUFDOUQsSUFBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUMxQixPQUFPLEtBQUssQ0FBQztJQUNmLENBQUM7dUdBYlUsU0FBUzsyR0FBVCxTQUFTLGNBREksTUFBTTs7MkZBQ25CLFNBQVM7a0JBRHJCLFVBQVU7bUJBQUMsRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBBY3RpdmF0ZWRSb3V0ZVNuYXBzaG90LCBSb3V0ZXJTdGF0ZVNuYXBzaG90IH0gZnJvbSAnQGFuZ3VsYXIvcm91dGVyJztcclxuaW1wb3J0IHsgQXV0aFNlcnZpY2UgfSBmcm9tICcuLi9zZXJ2aWNlcy9hdXRoLnNlcnZpY2UnO1xyXG5cclxuQEluamVjdGFibGUoeyBwcm92aWRlZEluOiAncm9vdCcgfSlcclxuZXhwb3J0IGNsYXNzIEF1dGhHdWFyZCAge1xyXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgYXV0aFNlcnZpY2U6IEF1dGhTZXJ2aWNlKSB7fVxyXG5cclxuICBjYW5BY3RpdmF0ZShyb3V0ZTogQWN0aXZhdGVkUm91dGVTbmFwc2hvdCwgc3RhdGU6IFJvdXRlclN0YXRlU25hcHNob3QpIHtcclxuICAgIGNvbnN0IGN1cnJlbnRVc2VyID0gbG9jYWxTdG9yYWdlLmdldEl0ZW0oJ2lzTG9nZ2VkSW4nKTtcclxuICAgIGlmIChjdXJyZW50VXNlciA9PT0gJ3RydWUnKSB7XHJcbiAgICAgIC8vIGxvZ2dlZCBpbiBzbyByZXR1cm4gdHJ1ZVxyXG4gICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH1cclxuXHJcbiAgICAvLyBub3QgbG9nZ2VkIGluIHNvIHJlZGlyZWN0IHRvIGxvZ2luIHBhZ2Ugd2l0aCB0aGUgcmV0dXJuIHVybFxyXG4gICAgdGhpcy5hdXRoU2VydmljZS5sb2dvdXQoKTtcclxuICAgIHJldHVybiBmYWxzZTtcclxuICB9XHJcbn1cclxuIl19
39
+ }], ctorParameters: () => [{ type: i1.AuthService }, { type: i2.GlobalStateService }, { type: i3.Router }] });
40
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aC5ndWFyZC5qcyIsInNvdXJjZVJvb3QiOiIiLC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jdGl2YXRlZFJvdXRlU25hcHNob3QsIHN0YXRlOiBSb3V0ZXJTdGF0ZVNuYXBzaG90KSB7XHJcblxyXG4gICAgLy8gY29uc3QgY3VycmVudFVzZXIgPSBsb2NhbFN0b3JhZ2UuZ2V0SXRlbSgnaXNMb2dnZWRJbicpO1xyXG4gICAgY29uc3QgY3VycmVudFVzZXIgPSBsb2NhbFN0b3JhZ2UuZ2V0SXRlbSh0aGlzLmF1dGhsb2NhbFN0b3JhZ2VUb2tlbik7XHJcbiAgICBpZiAoY3VycmVudFVzZXIpIHtcclxuICAgICAgICAgICAgLy8gdGhpcy5yb3V0ZS5uYXZpZ2F0ZShbJy9tYW5hZ2UvYnJhbmRzJ10pOyAgICBcclxuICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHRoaXMucm91dGUubmF2aWdhdGUoWycvYXV0aC9sb2dpbiddKTsgICAgXHJcblxyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19
@@ -117,6 +117,7 @@ class TangoAuthLoginComponent {
117
117
  fb;
118
118
  service;
119
119
  gs;
120
+ cd;
120
121
  toastService;
121
122
  defaultAuth = {
122
123
  email: "admin@demo.com",
@@ -132,12 +133,13 @@ class TangoAuthLoginComponent {
132
133
  };
133
134
  isLoading;
134
135
  authlocalStorageToken;
135
- constructor(router, route, fb, service, gs, toastService) {
136
+ constructor(router, route, fb, service, gs, cd, toastService) {
136
137
  this.router = router;
137
138
  this.route = route;
138
139
  this.fb = fb;
139
140
  this.service = service;
140
141
  this.gs = gs;
142
+ this.cd = cd;
141
143
  this.toastService = toastService;
142
144
  this.gs.environment.subscribe((env) => {
143
145
  if (env) {
@@ -202,8 +204,9 @@ class TangoAuthLoginComponent {
202
204
  this.service.userProfileDet().subscribe({
203
205
  next: (res) => {
204
206
  if (res && res.code == 200) {
205
- // this.router.navigate(['/manage/brands']);
206
- this.router.navigateByUrl(this.returnUrl);
207
+ this.cd.detectChanges();
208
+ this.router.navigate(['/manage/brands']);
209
+ // this.router.navigateByUrl(this.returnUrl);
207
210
  }
208
211
  },
209
212
  error: (err) => {
@@ -215,13 +218,13 @@ class TangoAuthLoginComponent {
215
218
  showPassword() {
216
219
  this.show = !this.show;
217
220
  }
218
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TangoAuthLoginComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: AuthService }, { token: i4.GlobalStateService }, { token: i4.ToastService }], target: i0.ɵɵFactoryTarget.Component });
221
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TangoAuthLoginComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2$1.FormBuilder }, { token: AuthService }, { token: i4.GlobalStateService }, { token: i0.ChangeDetectorRef }, { token: i4.ToastService }], target: i0.ɵɵFactoryTarget.Component });
219
222
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: TangoAuthLoginComponent, selector: "lib-tango-auth-login", ngImport: i0, template: "<!-- <div class=\"row justify-content-center logotext px-0\">\r\n <img src=\"./assets/tango/Icons/login-background.svg\" alt=\"\">\r\n </div> -->\r\n\r\n<!-- \r\n<button (click)=\"onClick()\">Log In</button> -->\r\n\r\n<div class=\"container\">\r\n <!-- style=\"padding: 96px 142px 96px 142px;\" -->\r\n <div class=\"row position-absolute\" >\r\n <div class=\"col-md-6 pe-10 d-flex justify-content-center align-items-center \">\r\n <img src=\"./assets/tango/Icons/LHS.svg\" alt=\"Image\" class=\"img-fluid\">\r\n </div>\r\n <div class=\"col-md-6 ps-10 d-flex justify-content-center align-items-center\"> \r\n <div class=\"card\">\r\n \r\n \r\n\r\n\r\n \r\n <div class=\"login-form login-signin w-100\">\r\n \r\n <div class=\"d-flex flex-column align-items-between title-padding\">\r\n <div class=\"text-start my-10 ms-10\">\r\n <h3 class=\"login-title\">Log in</h3>\r\n <p class=\"login-sub-title\">Welcome back! Please enter your details.</p>\r\n </div>\r\n <form #loginForm=\"ngForm\" class=\"w-100 title-padding\" novalidate=\"novalidate\">\r\n <div class=\"mb-5 \">\r\n <label for=\"Brand\" class=\"form-label\">Email</label>\r\n <input type=\"type\" class=\"form-control\" id=\"Email\" name=\"Email\" autocomplete=\"off\" required [(ngModel)]=\"credentials.email\" autocomplete=\"off\">\r\n </div>\r\n <div class=\"mb-5 \">\r\n <label for=\"Brand\" class=\"form-label\">Password</label>\r\n <div class=\"position-relative mb-3\">\r\n <input class=\"form-control\" id=\"Password\" [type]=\"show ? 'text' : 'password'\"\r\n placeholder=\"\" name=\"password\" autocomplete=\"off\" required\r\n [(ngModel)]=\"credentials.password\">\r\n <span (click)=\"showPassword()\"\r\n class=\"btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2\"\r\n data-kt-password-meter-control=\"visibility\">\r\n <i *ngIf=\"show\" class=\"fa fa-eye\" aria-hidden=\"true\"></i>\r\n <i *ngIf=\"!show\" class=\"fa fa-eye-slash\" aria-hidden=\"true\"></i>\r\n </span>\r\n </div>\r\n <div *ngIf=\"hasError\" class=\"text-danger\" style=\"color: #ffffff !important;\">\r\n Email Id / Mobile Number or Password is incorrect\r\n </div>\r\n </div>\r\n\r\n <h6 class=\"forgot\">Forgot Password</h6>\r\n <button class=\"btn btn-primary w-100 mt-3\" [disabled]=\"!loginForm.valid || (!credentials.email || !credentials.password)\" (click)=\"onLogin()\">Sign in</button>\r\n\r\n <button class=\"btn btn-outline w-100 mt-3\"><svg xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\">\r\n <g clip-path=\"url(#clip0_3727_17759)\">\r\n <path\r\n d=\"M24.2663 12.9767C24.2663 12.161 24.2001 11.3408 24.059 10.5383H12.7402V15.1593H19.222C18.953 16.6497 18.0888 17.9681 16.8233 18.8058V21.8042H20.6903C22.9611 19.7142 24.2663 16.6276 24.2663 12.9767Z\"\r\n fill=\"#4285F4\" />\r\n <path\r\n d=\"M12.7401 24.701C15.9766 24.701 18.7059 23.6384 20.6945 21.8041L16.8276 18.8057C15.7517 19.5377 14.3627 19.9522 12.7445 19.9522C9.61388 19.9522 6.95946 17.8401 6.00705 15.0005H2.0166V18.0914C4.05371 22.1436 8.2029 24.701 12.7401 24.701Z\"\r\n fill=\"#34A853\" />\r\n <path\r\n d=\"M6.00277 15.0004C5.50011 13.5101 5.50011 11.8962 6.00277 10.4059V7.31494H2.01674C0.314734 10.7057 0.314734 14.7006 2.01674 18.0913L6.00277 15.0004Z\"\r\n fill=\"#FBBC04\" />\r\n <path\r\n d=\"M12.7401 5.44986C14.4509 5.4234 16.1044 6.06716 17.3434 7.24886L20.7695 3.82281C18.6001 1.7857 15.7208 0.665729 12.7401 0.701004C8.2029 0.701004 4.05371 3.25842 2.0166 7.315L6.00264 10.4059C6.95064 7.56193 9.60947 5.44986 12.7401 5.44986Z\"\r\n fill=\"#EA4335\" />\r\n </g>\r\n <defs>\r\n <clipPath id=\"clip0_3727_17759\">\r\n <rect width=\"24\" height=\"24\" fill=\"white\" transform=\"translate(0.5 0.700195)\" />\r\n </clipPath>\r\n </defs>\r\n </svg><span class=\"mx-2\">Sign in with Google</span> </button>\r\n <button class=\"btn btn-outline w-100 mt-3\"><svg xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\">\r\n <g clip-path=\"url(#clip0_3727_6141)\">\r\n <path d=\"M11.9057 12.104H0.5V0.700195H11.9057V12.104Z\" fill=\"#F1511B\" />\r\n <path d=\"M24.5004 12.104H13.0938V0.700195H24.4994V12.104H24.5004Z\" fill=\"#80CC28\" />\r\n <path d=\"M11.9057 24.7002H0.5V13.2964H11.9057V24.7002Z\" fill=\"#00ADEF\" />\r\n <path d=\"M24.5004 24.7002H13.0938V13.2964H24.4994V24.7002H24.5004Z\" fill=\"#FBBC09\" />\r\n </g>\r\n <defs>\r\n <clipPath id=\"clip0_3727_6141\">\r\n <rect width=\"24\" height=\"24\" fill=\"white\" transform=\"translate(0.5 0.700195)\" />\r\n </clipPath>\r\n </defs>\r\n </svg><span class=\"mx-2\">Sign in with Microsoft</span></button>\r\n </form>\r\n\r\n <div class=\"mt-3 text-center ms-75px\"><span class=\"signup-default\"></span>Don\u2019t have an account?<span class=\"signup-primary ms-2 cursor-pointer\" routerLink=\"/auth/signup\">Sign up</span></div>\r\n </div>\r\n <div class=\" d-flex flex-column flex-md-row flex-md-stack pt-3 container-fluid\">\r\n <div class=\"text-gray-900 order-2 order-md-1 ms-10\">\r\n <span class=\"me-1 footer\">2024</span>\r\n <a target=\"_blank\" class=\"footer text-decoration-underline cursor-pointer\">&#64;TangoITSolutions India Pvt Ltd</a>\r\n </div>\r\n <ul class=\"menu menu-gray-600 menu-hover-primary fw-semibold order-1 me-7\">\r\n <li class=\"menu-item footer\"><a target=\"_blank\" href=\"https://tangoeye.ai/#aboutus\" class=\"menu-link px-5\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"13\" viewBox=\"0 0 12 13\" fill=\"none\">\r\n <path d=\"M11 3.7002C11 3.1502 10.55 2.7002 10 2.7002H2C1.45 2.7002 1 3.1502 1 3.7002M11 3.7002V9.7002C11 10.2502 10.55 10.7002 10 10.7002H2C1.45 10.7002 1 10.2502 1 9.7002V3.7002M11 3.7002L6 7.2002L1 3.7002\" stroke=\"#667085\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg><span class=\"ms-2\">support&#64;tangotech.co.in</span></a></li>\r\n \r\n </ul>\r\n </div>\r\n </div>\r\n \r\n\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n<img src=\"./assets/tango/Icons/login-background1.svg\" alt=\"Image\" class=\"background-image\">\r\n</div>", styles: [".container{width:100%;height:100%;overflow:hidden}.background-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;z-index:-1}.content{position:relative;z-index:1;width:45%;margin-left:auto;padding:20px;border-radius:16px;background:#fff;box-shadow:0 4px 10px #0000000d}.login-form .title-padding{padding:0 32px}.login-form .login-title{color:var(--Gray-900, #101828);font-size:36px;font-weight:600;line-height:44px;letter-spacing:-.72px}.login-form .login-sub-title{color:var(--Gray-500, #667085);font-size:16px;font-weight:400;line-height:24px}.login-form .form-label{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:500;line-height:20px}.login-form .img-src{padding:10px 5px 32px}.login-form .mx-25{margin-right:-10px!important;margin-left:-45px!important}.login-form .w-360px{width:360px!important}.login-form .forgot{color:var(--Primary-700, #009BF3)!important;font-size:14px!important;font-weight:600;line-height:20px;text-decoration-line:underline;text-transform:capitalize;text-align:center}.login-form .signup-default{color:var(--Gray-500, #667085)!important;font-size:14px!important;font-weight:400!important;line-height:20px}.login-form .signup-primary{color:var(--Primary-700, #009BF3)!important;font-size:14px;font-weight:600!important;line-height:20px;text-decoration-line:underline;text-transform:capitalize}.login-form .footer{color:var(--Gray-500, #667085)!important;font-size:12px!important;font-weight:400!important;line-height:20px}@media (min-width: 1745px) and (max-width: 1910px){.mt-6{margin-top:7rem!important}}@media (min-width: 1920px) and (max-width: 2100px){.mt-6{margin-top:10rem!important}.login-form .mx-25{margin-right:0!important;margin-left:20px!important}}.position-absolute{position:absolute;top:50%;transform:translateY(-50%)}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
220
223
  }
221
224
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TangoAuthLoginComponent, decorators: [{
222
225
  type: Component,
223
226
  args: [{ selector: "lib-tango-auth-login", template: "<!-- <div class=\"row justify-content-center logotext px-0\">\r\n <img src=\"./assets/tango/Icons/login-background.svg\" alt=\"\">\r\n </div> -->\r\n\r\n<!-- \r\n<button (click)=\"onClick()\">Log In</button> -->\r\n\r\n<div class=\"container\">\r\n <!-- style=\"padding: 96px 142px 96px 142px;\" -->\r\n <div class=\"row position-absolute\" >\r\n <div class=\"col-md-6 pe-10 d-flex justify-content-center align-items-center \">\r\n <img src=\"./assets/tango/Icons/LHS.svg\" alt=\"Image\" class=\"img-fluid\">\r\n </div>\r\n <div class=\"col-md-6 ps-10 d-flex justify-content-center align-items-center\"> \r\n <div class=\"card\">\r\n \r\n \r\n\r\n\r\n \r\n <div class=\"login-form login-signin w-100\">\r\n \r\n <div class=\"d-flex flex-column align-items-between title-padding\">\r\n <div class=\"text-start my-10 ms-10\">\r\n <h3 class=\"login-title\">Log in</h3>\r\n <p class=\"login-sub-title\">Welcome back! Please enter your details.</p>\r\n </div>\r\n <form #loginForm=\"ngForm\" class=\"w-100 title-padding\" novalidate=\"novalidate\">\r\n <div class=\"mb-5 \">\r\n <label for=\"Brand\" class=\"form-label\">Email</label>\r\n <input type=\"type\" class=\"form-control\" id=\"Email\" name=\"Email\" autocomplete=\"off\" required [(ngModel)]=\"credentials.email\" autocomplete=\"off\">\r\n </div>\r\n <div class=\"mb-5 \">\r\n <label for=\"Brand\" class=\"form-label\">Password</label>\r\n <div class=\"position-relative mb-3\">\r\n <input class=\"form-control\" id=\"Password\" [type]=\"show ? 'text' : 'password'\"\r\n placeholder=\"\" name=\"password\" autocomplete=\"off\" required\r\n [(ngModel)]=\"credentials.password\">\r\n <span (click)=\"showPassword()\"\r\n class=\"btn btn-sm btn-icon position-absolute translate-middle top-50 end-0 me-n2\"\r\n data-kt-password-meter-control=\"visibility\">\r\n <i *ngIf=\"show\" class=\"fa fa-eye\" aria-hidden=\"true\"></i>\r\n <i *ngIf=\"!show\" class=\"fa fa-eye-slash\" aria-hidden=\"true\"></i>\r\n </span>\r\n </div>\r\n <div *ngIf=\"hasError\" class=\"text-danger\" style=\"color: #ffffff !important;\">\r\n Email Id / Mobile Number or Password is incorrect\r\n </div>\r\n </div>\r\n\r\n <h6 class=\"forgot\">Forgot Password</h6>\r\n <button class=\"btn btn-primary w-100 mt-3\" [disabled]=\"!loginForm.valid || (!credentials.email || !credentials.password)\" (click)=\"onLogin()\">Sign in</button>\r\n\r\n <button class=\"btn btn-outline w-100 mt-3\"><svg xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\">\r\n <g clip-path=\"url(#clip0_3727_17759)\">\r\n <path\r\n d=\"M24.2663 12.9767C24.2663 12.161 24.2001 11.3408 24.059 10.5383H12.7402V15.1593H19.222C18.953 16.6497 18.0888 17.9681 16.8233 18.8058V21.8042H20.6903C22.9611 19.7142 24.2663 16.6276 24.2663 12.9767Z\"\r\n fill=\"#4285F4\" />\r\n <path\r\n d=\"M12.7401 24.701C15.9766 24.701 18.7059 23.6384 20.6945 21.8041L16.8276 18.8057C15.7517 19.5377 14.3627 19.9522 12.7445 19.9522C9.61388 19.9522 6.95946 17.8401 6.00705 15.0005H2.0166V18.0914C4.05371 22.1436 8.2029 24.701 12.7401 24.701Z\"\r\n fill=\"#34A853\" />\r\n <path\r\n d=\"M6.00277 15.0004C5.50011 13.5101 5.50011 11.8962 6.00277 10.4059V7.31494H2.01674C0.314734 10.7057 0.314734 14.7006 2.01674 18.0913L6.00277 15.0004Z\"\r\n fill=\"#FBBC04\" />\r\n <path\r\n d=\"M12.7401 5.44986C14.4509 5.4234 16.1044 6.06716 17.3434 7.24886L20.7695 3.82281C18.6001 1.7857 15.7208 0.665729 12.7401 0.701004C8.2029 0.701004 4.05371 3.25842 2.0166 7.315L6.00264 10.4059C6.95064 7.56193 9.60947 5.44986 12.7401 5.44986Z\"\r\n fill=\"#EA4335\" />\r\n </g>\r\n <defs>\r\n <clipPath id=\"clip0_3727_17759\">\r\n <rect width=\"24\" height=\"24\" fill=\"white\" transform=\"translate(0.5 0.700195)\" />\r\n </clipPath>\r\n </defs>\r\n </svg><span class=\"mx-2\">Sign in with Google</span> </button>\r\n <button class=\"btn btn-outline w-100 mt-3\"><svg xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"none\">\r\n <g clip-path=\"url(#clip0_3727_6141)\">\r\n <path d=\"M11.9057 12.104H0.5V0.700195H11.9057V12.104Z\" fill=\"#F1511B\" />\r\n <path d=\"M24.5004 12.104H13.0938V0.700195H24.4994V12.104H24.5004Z\" fill=\"#80CC28\" />\r\n <path d=\"M11.9057 24.7002H0.5V13.2964H11.9057V24.7002Z\" fill=\"#00ADEF\" />\r\n <path d=\"M24.5004 24.7002H13.0938V13.2964H24.4994V24.7002H24.5004Z\" fill=\"#FBBC09\" />\r\n </g>\r\n <defs>\r\n <clipPath id=\"clip0_3727_6141\">\r\n <rect width=\"24\" height=\"24\" fill=\"white\" transform=\"translate(0.5 0.700195)\" />\r\n </clipPath>\r\n </defs>\r\n </svg><span class=\"mx-2\">Sign in with Microsoft</span></button>\r\n </form>\r\n\r\n <div class=\"mt-3 text-center ms-75px\"><span class=\"signup-default\"></span>Don\u2019t have an account?<span class=\"signup-primary ms-2 cursor-pointer\" routerLink=\"/auth/signup\">Sign up</span></div>\r\n </div>\r\n <div class=\" d-flex flex-column flex-md-row flex-md-stack pt-3 container-fluid\">\r\n <div class=\"text-gray-900 order-2 order-md-1 ms-10\">\r\n <span class=\"me-1 footer\">2024</span>\r\n <a target=\"_blank\" class=\"footer text-decoration-underline cursor-pointer\">&#64;TangoITSolutions India Pvt Ltd</a>\r\n </div>\r\n <ul class=\"menu menu-gray-600 menu-hover-primary fw-semibold order-1 me-7\">\r\n <li class=\"menu-item footer\"><a target=\"_blank\" href=\"https://tangoeye.ai/#aboutus\" class=\"menu-link px-5\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"13\" viewBox=\"0 0 12 13\" fill=\"none\">\r\n <path d=\"M11 3.7002C11 3.1502 10.55 2.7002 10 2.7002H2C1.45 2.7002 1 3.1502 1 3.7002M11 3.7002V9.7002C11 10.2502 10.55 10.7002 10 10.7002H2C1.45 10.7002 1 10.2502 1 9.7002V3.7002M11 3.7002L6 7.2002L1 3.7002\" stroke=\"#667085\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n </svg><span class=\"ms-2\">support&#64;tangotech.co.in</span></a></li>\r\n \r\n </ul>\r\n </div>\r\n </div>\r\n \r\n\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n<img src=\"./assets/tango/Icons/login-background1.svg\" alt=\"Image\" class=\"background-image\">\r\n</div>", styles: [".container{width:100%;height:100%;overflow:hidden}.background-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;z-index:-1}.content{position:relative;z-index:1;width:45%;margin-left:auto;padding:20px;border-radius:16px;background:#fff;box-shadow:0 4px 10px #0000000d}.login-form .title-padding{padding:0 32px}.login-form .login-title{color:var(--Gray-900, #101828);font-size:36px;font-weight:600;line-height:44px;letter-spacing:-.72px}.login-form .login-sub-title{color:var(--Gray-500, #667085);font-size:16px;font-weight:400;line-height:24px}.login-form .form-label{color:var(--Gray-700, #344054)!important;font-size:14px!important;font-weight:500;line-height:20px}.login-form .img-src{padding:10px 5px 32px}.login-form .mx-25{margin-right:-10px!important;margin-left:-45px!important}.login-form .w-360px{width:360px!important}.login-form .forgot{color:var(--Primary-700, #009BF3)!important;font-size:14px!important;font-weight:600;line-height:20px;text-decoration-line:underline;text-transform:capitalize;text-align:center}.login-form .signup-default{color:var(--Gray-500, #667085)!important;font-size:14px!important;font-weight:400!important;line-height:20px}.login-form .signup-primary{color:var(--Primary-700, #009BF3)!important;font-size:14px;font-weight:600!important;line-height:20px;text-decoration-line:underline;text-transform:capitalize}.login-form .footer{color:var(--Gray-500, #667085)!important;font-size:12px!important;font-weight:400!important;line-height:20px}@media (min-width: 1745px) and (max-width: 1910px){.mt-6{margin-top:7rem!important}}@media (min-width: 1920px) and (max-width: 2100px){.mt-6{margin-top:10rem!important}.login-form .mx-25{margin-right:0!important;margin-left:20px!important}}.position-absolute{position:absolute;top:50%;transform:translateY(-50%)}\n"] }]
224
- }], ctorParameters: () => [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: AuthService }, { type: i4.GlobalStateService }, { type: i4.ToastService }] });
227
+ }], ctorParameters: () => [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2$1.FormBuilder }, { type: AuthService }, { type: i4.GlobalStateService }, { type: i0.ChangeDetectorRef }, { type: i4.ToastService }] });
225
228
 
226
229
  class ConversionService {
227
230
  filtersSubject = new Subject();
@@ -758,9 +761,11 @@ class Step2Component {
758
761
  },
759
762
  });
760
763
  }
761
- else {
764
+ else if (this.timevalue === 'time') {
765
+ window.open('https://calendly.com/hello-tango/connect_tango_eye', "_blank");
762
766
  this.popup = false;
763
767
  this.requestpopup = true;
768
+ this.cd.detectChanges();
764
769
  }
765
770
  }
766
771
  close() {
@@ -1184,26 +1189,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1184
1189
 
1185
1190
  class AuthGuard {
1186
1191
  authService;
1187
- constructor(authService) {
1192
+ gs;
1193
+ route;
1194
+ authlocalStorageToken;
1195
+ constructor(authService, gs, route) {
1188
1196
  this.authService = authService;
1197
+ this.gs = gs;
1198
+ this.route = route;
1199
+ this.gs.environment.subscribe((env) => {
1200
+ if (env) {
1201
+ this.authlocalStorageToken = `${env.appVersion}-${env.USERDATA_KEY}`;
1202
+ }
1203
+ });
1189
1204
  }
1190
1205
  canActivate(route, state) {
1191
- const currentUser = localStorage.getItem('isLoggedIn');
1192
- if (currentUser === 'true') {
1193
- // logged in so return true
1206
+ // const currentUser = localStorage.getItem('isLoggedIn');
1207
+ const currentUser = localStorage.getItem(this.authlocalStorageToken);
1208
+ if (currentUser) {
1209
+ // this.route.navigate(['/manage/brands']);
1194
1210
  return true;
1195
1211
  }
1196
- // not logged in so redirect to login page with the return url
1197
- this.authService.logout();
1198
- return false;
1212
+ else {
1213
+ this.route.navigate(['/auth/login']);
1214
+ return false;
1215
+ }
1199
1216
  }
1200
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
1217
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, deps: [{ token: AuthService }, { token: i4.GlobalStateService }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1201
1218
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, providedIn: 'root' });
1202
1219
  }
1203
1220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AuthGuard, decorators: [{
1204
1221
  type: Injectable,
1205
1222
  args: [{ providedIn: 'root' }]
1206
- }], ctorParameters: () => [{ type: AuthService }] });
1223
+ }], ctorParameters: () => [{ type: AuthService }, { type: i4.GlobalStateService }, { type: i1.Router }] });
1207
1224
 
1208
1225
  /*
1209
1226
  * Public API Surface of tango-auth