@fluxhub/fluxhub-lib 19.0.74 → 19.0.75

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.
@@ -1155,6 +1155,8 @@ class AuthenticationService {
1155
1155
  this.url = this.app_s.API_ENDPOINT + this.app_s.LOGIN_ENDPOINT;
1156
1156
  }
1157
1157
  logout(resetPosition = true) {
1158
+ console.log('[AuthService] LOGOUT called - resetPosition:', resetPosition);
1159
+ console.trace('[AuthService] Logout stack trace');
1158
1160
  this.app_s.user = null;
1159
1161
  this.app_s.user_name = null;
1160
1162
  this.app_s.user_surname = null;
@@ -1166,6 +1168,7 @@ class AuthenticationService {
1166
1168
  this.app_s.token = null;
1167
1169
  localStorage.removeItem(this.app_s.COMPANY_KEY + "token");
1168
1170
  localStorage.removeItem(this.app_s.COMPANY_KEY + "refreshToken");
1171
+ console.log('[AuthService] Tokens removed from localStorage');
1169
1172
  if (resetPosition)
1170
1173
  this.goto_after = '';
1171
1174
  if (this.app_s.LOGIN_EXT != 1)
@@ -1201,19 +1204,23 @@ class AuthenticationService {
1201
1204
  }
1202
1205
  else {
1203
1206
  if (res.token) {
1207
+ console.log('[AuthService] Login successful - saving token to localStorage with key:', this.app_s.COMPANY_KEY + "token");
1204
1208
  localStorage.setItem(this.app_s.COMPANY_KEY + "token", res.token);
1205
1209
  }
1206
1210
  if (res.refreshToken) {
1211
+ console.log('[AuthService] Saving refreshToken to localStorage');
1207
1212
  localStorage.setItem(this.app_s.COMPANY_KEY + "refreshToken", res.refreshToken);
1208
1213
  res.result_data = [{ token: res.token, refreshToken: res.refreshToken }];
1209
1214
  return res || new QGResult();
1210
1215
  }
1211
1216
  if (res.refreshtoken) {
1217
+ console.log('[AuthService] Saving refreshtoken (lowercase) to localStorage');
1212
1218
  localStorage.setItem(this.app_s.COMPANY_KEY + "refreshToken", res.refreshtoken);
1213
1219
  res.result_data = [{ token: res.token, refreshToken: res.refreshtoken }];
1214
1220
  return res || new QGResult();
1215
1221
  }
1216
1222
  if (res.result_data.length > 0) {
1223
+ console.log('[AuthService] Saving token from result_data to localStorage');
1217
1224
  localStorage.setItem(this.app_s.COMPANY_KEY + "token", res.result_data[0].token);
1218
1225
  }
1219
1226
  }
@@ -1519,7 +1526,9 @@ class AuthenticationService {
1519
1526
  checkCredentials() {
1520
1527
  if ("/login" != this.router.url && this.router.url.indexOf("/rp/") == -1)
1521
1528
  this.goto_after = window.location.toString();
1522
- if (localStorage.getItem(this.app_s.COMPANY_KEY + "token") === null) {
1529
+ const hasToken = localStorage.getItem(this.app_s.COMPANY_KEY + "token") !== null;
1530
+ console.log('[AuthService] checkCredentials - hasToken:', hasToken, 'COMPANY_KEY:', this.app_s.COMPANY_KEY);
1531
+ if (!hasToken) {
1523
1532
  return false;
1524
1533
  }
1525
1534
  return true;