tango-app-ui-auth 3.5.0-beta.1 → 3.5.0-beta.2
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.
@@ -8,6 +8,7 @@ import * as i2$1 from '@angular/forms';
|
|
8
8
|
import { Validators, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
9
9
|
import { BehaviorSubject, of, map, catchError, throwError, Subject, takeUntil, timer } from 'rxjs';
|
10
10
|
import dayjs from 'dayjs';
|
11
|
+
import CryptoJS from 'crypto-js';
|
11
12
|
import * as i2 from '@angular/common/http';
|
12
13
|
import * as i4 from 'tango-app-ui-global';
|
13
14
|
import * as i5 from 'tango-app-ui-shared';
|
@@ -156,6 +157,7 @@ class TangoAuthLoginComponent {
|
|
156
157
|
emailInputRef;
|
157
158
|
passwordInputRef;
|
158
159
|
authlocalStorageToken;
|
160
|
+
secretKey;
|
159
161
|
destroy$ = new Subject();
|
160
162
|
pageSection = 'login';
|
161
163
|
otp = '';
|
@@ -175,6 +177,7 @@ class TangoAuthLoginComponent {
|
|
175
177
|
this.gs.environment.pipe(takeUntil(this.destroy$)).subscribe((env) => {
|
176
178
|
if (env) {
|
177
179
|
this.authlocalStorageToken = `${env.appVersion}-${env.USERDATA_KEY}`;
|
180
|
+
this.secretKey = env.secretKey;
|
178
181
|
}
|
179
182
|
});
|
180
183
|
if (this.service.currentUserValue) {
|
@@ -235,7 +238,11 @@ class TangoAuthLoginComponent {
|
|
235
238
|
if (resend) {
|
236
239
|
delete this.credentials['otp'];
|
237
240
|
}
|
241
|
+
const addonPassword = `${this.credentials.password}___${Math.floor(Date.now() / 1000)}`;
|
242
|
+
const secretKey = this.secretKey;
|
243
|
+
const encrypted = CryptoJS.AES.encrypt(addonPassword, secretKey).toString();
|
238
244
|
// this.credentials.password = crypto.AES.encrypt( this.credentials.password,'fc7154e0' ).toString();
|
245
|
+
this.credentials.password = encrypted;
|
239
246
|
this.service.login(this.credentials).pipe(takeUntil(this.destroy$)).subscribe({
|
240
247
|
next: (res) => {
|
241
248
|
if (res && res?.code === 200) {
|