@gandalan/weblibs 1.1.61 → 1.1.62
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.
- package/api/fluentApi.js +3 -25
- package/api/fluentAuthBuilder.js +3 -4
- package/package.json +1 -1
package/api/fluentApi.js
CHANGED
|
@@ -292,7 +292,8 @@ export function createApi() {
|
|
|
292
292
|
globalThis.idasTokens.refreshToken = this.refreshToken;
|
|
293
293
|
localStorage.setItem("idas-refresh-token", this.refreshToken);
|
|
294
294
|
} catch (e) {
|
|
295
|
-
this.redirectToLogin();
|
|
295
|
+
//this.redirectToLogin();
|
|
296
|
+
console.error("not authenticated", e);
|
|
296
297
|
}
|
|
297
298
|
},
|
|
298
299
|
|
|
@@ -318,30 +319,7 @@ export function createApi() {
|
|
|
318
319
|
if (!this.authUrl) {
|
|
319
320
|
throw new Error("authUrl not set");
|
|
320
321
|
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Redirect to the login page
|
|
325
|
-
*
|
|
326
|
-
* @param {string} [authPath=""]
|
|
327
|
-
* @private
|
|
328
|
-
*/
|
|
329
|
-
redirectToLogin(authPath = "") {
|
|
330
|
-
if (!window) {
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
const authEndpoint = (new URL(window.location.href).origin) + authPath;
|
|
335
|
-
let authUrlCallback = `${authEndpoint}?r=%target%&j=%jwt%&m=%mandant%`;
|
|
336
|
-
authUrlCallback = authUrlCallback.replace("%target%", encodeURIComponent(window.location.href));
|
|
337
|
-
|
|
338
|
-
const url = new URL(this.authUrl);
|
|
339
|
-
url.pathname = "/Session";
|
|
340
|
-
url.search = `?a=${this.appToken}&r=${encodeURIComponent(authUrlCallback)}`;
|
|
341
|
-
let loginUrl = url.toString();
|
|
342
|
-
|
|
343
|
-
window.location.href = loginUrl;
|
|
344
|
-
},
|
|
322
|
+
}
|
|
345
323
|
};
|
|
346
324
|
}
|
|
347
325
|
|
package/api/fluentAuthBuilder.js
CHANGED
|
@@ -179,14 +179,13 @@ export function authBuilder() {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
const redirectAfterAuth = new URL(window.location.href).origin;
|
|
182
|
-
let redirectUrl = `${redirectAfterAuth}?r=%target%&j=%jwt%&m=%mandant%`;
|
|
183
|
-
redirectUrl = redirectUrl.replace("%target%", encodeURIComponent(window.location.href));
|
|
184
|
-
|
|
182
|
+
//let redirectUrl = `${redirectAfterAuth}?r=%target%&j=%jwt%&m=%mandant%`;
|
|
183
|
+
//redirectUrl = redirectUrl.replace("%target%", encodeURIComponent(window.location.href));
|
|
184
|
+
let redirectUrl = `${redirectAfterAuth}?t=%token%`;
|
|
185
185
|
const url = new URL(this.authUrl);
|
|
186
186
|
url.pathname = "/Session";
|
|
187
187
|
url.search = `?a=${this.appToken}&r=${encodeURIComponent(redirectUrl)}`;
|
|
188
188
|
let loginUrl = url.toString();
|
|
189
|
-
|
|
190
189
|
window.location.href = loginUrl;
|
|
191
190
|
}
|
|
192
191
|
};
|