@uiapplib/ngx-ui-web-lib 0.0.2 → 0.0.5

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.
@@ -231,10 +231,7 @@ const LibConstants = {
231
231
  appVersion: window["env"]["appVersion"] || "localhost",
232
232
  ssoCookieName: window["env"]["ssoCookieName"] || "SSO_COOKIE_DEV",
233
233
  ssoDomain: window["env"]["ssoDomain"] || ".mdes.ms.gov",
234
- oauthClientUser: window["env"]["oauthClientUser"] || "mobile",
235
- oauthClientSecret: window["env"]["oauthClientSecret"] || "pin",
236
- oauthWingsClientUser: window["env"]["oauthWingsClientUser"] || "wingsuser",
237
- oauthWingsClientSecret: window["env"]["oauthWingsClientSecret"] || "wingspass",
234
+ ocu: window["env"]["ocu"] || "mobile",
238
235
  enableChatbot: window["env"]["enableChatbot"] || 'true',
239
236
  enableLanguageChange: window["env"]["enableLanguageChange"] || 'false',
240
237
  PhaseTwoProofOfUIView: window["env"]["PhaseTwoProofOfUIView"] || 'false',
@@ -1644,26 +1641,25 @@ class LoginService {
1644
1641
  return this.util.postFormData('oauth/token', authData, this.options);
1645
1642
  }
1646
1643
  async refreshToken(refreshToken) {
1644
+ console.log('ss');
1647
1645
  let headers = new HttpHeaders({
1648
- "Accept": "application/x-www-form-urlencoded",
1649
- 'Authorization': `Basic ` + btoa(`${LibConstants.oauthClientUser}:${LibConstants.oauthClientSecret}`)
1646
+ "Accept": "application/x-www-form-urlencoded"
1650
1647
  });
1651
1648
  this.options = { headers: headers };
1652
1649
  let authData = new FormData();
1653
1650
  authData.set('grant_type', 'refresh_token');
1654
- authData.set('client_id', LibConstants.oauthClientUser);
1651
+ authData.set('client_id', LibConstants.ocu);
1655
1652
  authData.set('refresh_token', refreshToken);
1656
1653
  return this.util.postFormData(`oauth/token`, authData, this.options).toPromise();
1657
1654
  }
1658
1655
  async refreshTokenWings(refreshToken) {
1659
1656
  let headers = new HttpHeaders({
1660
- "Accept": "application/x-www-form-urlencoded",
1661
- 'Authorization': `Basic ` + btoa(`${LibConstants.oauthWingsClientUser}:${LibConstants.oauthWingsClientSecret}`)
1657
+ "Accept": "application/x-www-form-urlencoded"
1662
1658
  });
1663
1659
  this.options = { headers: headers };
1664
1660
  let authData = new FormData();
1665
1661
  authData.set('grant_type', 'refresh_token');
1666
- authData.set('client_id', LibConstants.oauthWingsClientUser);
1662
+ //authData.set('client_id', LibConstants.oauthWingsClientUser);
1667
1663
  authData.set('refresh_token', refreshToken);
1668
1664
  return this.util.postFormData(`oauth/token`, authData, this.options).toPromise();
1669
1665
  }
@@ -8608,6 +8604,7 @@ class UserLoginComponent {
8608
8604
  let auth = {};
8609
8605
  auth.userId = this.username.value;
8610
8606
  auth.password = this.password.value;
8607
+ console.log('async login');
8611
8608
  this.util
8612
8609
  .showLoader()
8613
8610
  .then(() => {
@@ -51512,7 +51509,7 @@ class HttpHeaderInterceptor {
51512
51509
  }
51513
51510
  intercept(request, next) {
51514
51511
  // add authorization header with jwt token if available
51515
- this.logger.log('[HttpHeaderInterceptor] Inside Interceptor before --> ', request);
51512
+ console.log('[HttpHeaderInterceptor] Inside Interceptor before --> ', request);
51516
51513
  //this.util.showLoader();
51517
51514
  let currentUser = this.loginService.getUser();
51518
51515
  if (currentUser && !(request.url.includes("/oauth/token") ||
@@ -51523,15 +51520,15 @@ class HttpHeaderInterceptor {
51523
51520
  .append('Authorization', `Bearer ${currentUser.access_token}`)
51524
51521
  });
51525
51522
  }
51526
- if (!(currentUser && currentUser.username) && (request.url.includes("/oauth/token") || request.url.includes('/check_token'))) {
51527
- if (!request.headers.get('Authorization')) {
51528
- request = request.clone({
51529
- withCredentials: false,
51530
- headers: request.headers
51531
- .append('Authorization', `Basic ` + btoa(`${LibConstants.oauthClientUser}:${LibConstants.oauthClientSecret}`))
51532
- });
51533
- }
51534
- }
51523
+ /* if(!(currentUser && currentUser.username) && (request.url.includes("/oauth/token") || request.url.includes('/check_token')) ){
51524
+ if(!request.headers.get('Authorization')){
51525
+ request = request.clone({
51526
+ withCredentials: false,
51527
+ headers: request.headers
51528
+ .append('Authorization', `Basic ` + btoa(`${LibConstants.oauthClientUser}:${LibConstants.oauthClientSecret}`))
51529
+ });
51530
+ }
51531
+ }*/
51535
51532
  let value = localStorage.getItem('language');
51536
51533
  let language = value != null ? value : 'en';
51537
51534
  request = request.clone({