ngx-techlify-core 14.4.0 → 14.4.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.
@@ -31,7 +31,7 @@ import { UntypedFormControl, Validators, ReactiveFormsModule, FormsModule } from
31
31
  import * as i1$2 from '@angular/common/http';
32
32
  import { HttpResponse, HttpClient, HttpClientModule } from '@angular/common/http';
33
33
  import { throwError, Observable, Subject, fromEvent, of, from, interval } from 'rxjs';
34
- import { catchError, debounceTime, takeUntil, tap, distinctUntilChanged, startWith, switchMap, finalize, concatMap, filter } from 'rxjs/operators';
34
+ import { catchError, debounceTime, takeUntil, tap, distinctUntilChanged, startWith, switchMap, finalize, map, filter } from 'rxjs/operators';
35
35
  import * as i1$1 from '@angular/material/snack-bar';
36
36
  import { MAT_SNACK_BAR_DATA, MatSnackBarModule } from '@angular/material/snack-bar';
37
37
  import * as i6$1 from '@angular/material/form-field';
@@ -3385,15 +3385,15 @@ class AuthenticationService {
3385
3385
  return this.http
3386
3386
  .skipToken()
3387
3387
  .post('oauth/token', context)
3388
- .pipe(concatMap(async (tokenInfo) => {
3388
+ .pipe(switchMap((tokenInfo) => {
3389
3389
  tokenInfo.expires_in = Date.now() + (tokenInfo.expires_in * 1000);
3390
3390
  data.token = tokenInfo;
3391
3391
  data.user = {};
3392
- this.credentialsService.setCredentials(data, context.remember);
3393
- const userInfo = await this.http.get('api/user/current').toPromise();
3394
- data.user = userInfo?.user;
3395
- this.credentialsService.setCredentials(data, context.remember);
3396
- return data;
3392
+ return this.http.get('api/user/current')
3393
+ .pipe(map((res) => {
3394
+ data.user = res?.user;
3395
+ return data;
3396
+ }), finalize(() => this.credentialsService.setCredentials(data, context.remember)));
3397
3397
  }));
3398
3398
  }
3399
3399
  /**