@trudb/tru-common-lib 0.0.703 → 0.0.705

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.
@@ -3721,13 +3721,11 @@ class TruAuth {
3721
3721
  login(loginRequest) {
3722
3722
  return this.http
3723
3723
  .post(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/login`, loginRequest)
3724
- .pipe(tap(switchMap(data => this.http
3725
- .post(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/user`, this.createUserRequest(loginRequest.username))
3726
- .pipe(tap((user) => {
3727
- this.auth.doLoginUser(data);
3728
- this.user.create(user);
3724
+ .pipe(tap((tokenData) => this.tokenData = tokenData), switchMap(() => this.http.post(`${this.baseUrl}${TRU_AUTH_CONFIG.authUrl}/user`, this.createUserRequest(loginRequest.username)).pipe(tap((userData) => {
3725
+ this.auth.doLoginUser(this.tokenData);
3726
+ this.user.create(userData);
3729
3727
  this.loggedIn.next(true);
3730
- })))));
3728
+ }))));
3731
3729
  }
3732
3730
  logout() {
3733
3731
  this.doLogoutUser();