@klauswuestefeld/jux-web 2025.2.11 → 2025.5.24

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/dist/jux-web.js CHANGED
@@ -14550,13 +14550,23 @@ var juxWeb = (function (exports) {
14550
14550
  Array.from(clientApp.children).forEach(el => el.remove());
14551
14551
  clientApp.appendChild(page);
14552
14552
  };
14553
- const getSSOCallbackURI = () => {
14553
+ const getBaseElementHref = () => {
14554
+ const baseElement = document.getElementsByTagName('base')[0];
14555
+ if (!baseElement)
14556
+ return null;
14557
+ return baseElement.href || null;
14558
+ };
14559
+ const produceSSORedirectURI = () => {
14560
+ const baseElementHref = getBaseElementHref();
14561
+ if (baseElementHref)
14562
+ return baseElementHref;
14554
14563
  const { protocol, host } = window.location;
14555
- return protocol + '//' + host + '/callback';
14564
+ return protocol + '//' + host + '/';
14556
14565
  };
14566
+ const getSSORedirectURI = () => produceSSORedirectURI() + 'callback';
14557
14567
  const handleSSOLogin = () => {
14558
14568
  const onSuccess = (authEndpoint) => {
14559
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
14569
+ const authUrl = authEndpoint + `&redirect_uri=${getSSORedirectURI()}`;
14560
14570
  window.location.replace(authUrl);
14561
14571
  };
14562
14572
  const onError = () => onAuthenticationFailure('login-failed');
@@ -14601,7 +14611,7 @@ var juxWeb = (function (exports) {
14601
14611
  }
14602
14612
  const ssoToken = extractTokenFromWindowLocation('code');
14603
14613
  if (ssoToken) {
14604
- validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter$2(void 0, void 0, void 0, function* () {
14614
+ validateSSOToken(ssoToken, getSSORedirectURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter$2(void 0, void 0, void 0, function* () {
14605
14615
  const jsonResponse = yield res.json();
14606
14616
  const unauthorizedEmail = jsonResponse.email;
14607
14617
  const onReturn = () => handleSSOLogin();
package/dist/main.esm.js CHANGED
@@ -1035,13 +1035,23 @@ const displayPage = (clientApp, page) => {
1035
1035
  Array.from(clientApp.children).forEach(el => el.remove());
1036
1036
  clientApp.appendChild(page);
1037
1037
  };
1038
- const getSSOCallbackURI = () => {
1038
+ const getBaseElementHref = () => {
1039
+ const baseElement = document.getElementsByTagName('base')[0];
1040
+ if (!baseElement)
1041
+ return null;
1042
+ return baseElement.href || null;
1043
+ };
1044
+ const produceSSORedirectURI = () => {
1045
+ const baseElementHref = getBaseElementHref();
1046
+ if (baseElementHref)
1047
+ return baseElementHref;
1039
1048
  const { protocol, host } = window.location;
1040
- return protocol + '//' + host + '/callback';
1049
+ return protocol + '//' + host + '/';
1041
1050
  };
1051
+ const getSSORedirectURI = () => produceSSORedirectURI() + 'callback';
1042
1052
  const handleSSOLogin = () => {
1043
1053
  const onSuccess = (authEndpoint) => {
1044
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1054
+ const authUrl = authEndpoint + `&redirect_uri=${getSSORedirectURI()}`;
1045
1055
  window.location.replace(authUrl);
1046
1056
  };
1047
1057
  const onError = () => onAuthenticationFailure('login-failed');
@@ -1086,7 +1096,7 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, onLoginError,
1086
1096
  }
1087
1097
  const ssoToken = extractTokenFromWindowLocation('code');
1088
1098
  if (ssoToken) {
1089
- validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter(void 0, void 0, void 0, function* () {
1099
+ validateSSOToken(ssoToken, getSSORedirectURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter(void 0, void 0, void 0, function* () {
1090
1100
  const jsonResponse = yield res.json();
1091
1101
  const unauthorizedEmail = jsonResponse.email;
1092
1102
  const onReturn = () => handleSSOLogin();
package/dist/main.js CHANGED
@@ -1059,13 +1059,23 @@ const displayPage = (clientApp, page) => {
1059
1059
  Array.from(clientApp.children).forEach(el => el.remove());
1060
1060
  clientApp.appendChild(page);
1061
1061
  };
1062
- const getSSOCallbackURI = () => {
1062
+ const getBaseElementHref = () => {
1063
+ const baseElement = document.getElementsByTagName('base')[0];
1064
+ if (!baseElement)
1065
+ return null;
1066
+ return baseElement.href || null;
1067
+ };
1068
+ const produceSSORedirectURI = () => {
1069
+ const baseElementHref = getBaseElementHref();
1070
+ if (baseElementHref)
1071
+ return baseElementHref;
1063
1072
  const { protocol, host } = window.location;
1064
- return protocol + '//' + host + '/callback';
1073
+ return protocol + '//' + host + '/';
1065
1074
  };
1075
+ const getSSORedirectURI = () => produceSSORedirectURI() + 'callback';
1066
1076
  const handleSSOLogin = () => {
1067
1077
  const onSuccess = (authEndpoint) => {
1068
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1078
+ const authUrl = authEndpoint + `&redirect_uri=${getSSORedirectURI()}`;
1069
1079
  window.location.replace(authUrl);
1070
1080
  };
1071
1081
  const onError = () => onAuthenticationFailure('login-failed');
@@ -1110,7 +1120,7 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, onLoginError,
1110
1120
  }
1111
1121
  const ssoToken = extractTokenFromWindowLocation('code');
1112
1122
  if (ssoToken) {
1113
- validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter(void 0, void 0, void 0, function* () {
1123
+ validateSSOToken(ssoToken, getSSORedirectURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), (_res) => onAuthenticationFailure('login-failed'), (res) => __awaiter(void 0, void 0, void 0, function* () {
1114
1124
  const jsonResponse = yield res.json();
1115
1125
  const unauthorizedEmail = jsonResponse.email;
1116
1126
  const onReturn = () => handleSSOLogin();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2025.02.11",
3
+ "version": "2025.5.24",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",