@klauswuestefeld/jux-web 2024.11.12 → 2024.11.19

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
@@ -14344,6 +14344,14 @@ var juxWeb = (function (exports) {
14344
14344
  const { protocol, host } = window.location;
14345
14345
  return protocol + '//' + host + '/callback';
14346
14346
  };
14347
+ const handleSSOLogin = () => {
14348
+ const onSuccess = (authEndpoint) => {
14349
+ const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
14350
+ window.location.replace(authUrl);
14351
+ };
14352
+ const onError = () => onAuthenticationFailure('login-failed');
14353
+ getSSOAuthorizationEndpoint(onSuccess, onError);
14354
+ };
14347
14355
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
14348
14356
  // if (startNewDemo()) {
14349
14357
  // initDemo(setBackendToken, onAuthentication);
@@ -14386,6 +14394,10 @@ var juxWeb = (function (exports) {
14386
14394
  validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), () => onAuthenticationFailure('login-failed'));
14387
14395
  return;
14388
14396
  }
14397
+ if (supportedLoginTypes.includes('SSO')) {
14398
+ handleSSOLogin();
14399
+ return;
14400
+ }
14389
14401
  displayPage(clientApp, loginPage(clientApp, backgroundImage, onUserLogin, supportedLoginTypes));
14390
14402
  // validateThirdPartyCookies(initGapi, () => displayPage(Page.LOGIN));
14391
14403
  // checkMixpanel(() => mixpanel.track('View Login Page'));
@@ -14428,14 +14440,6 @@ var juxWeb = (function (exports) {
14428
14440
  authSignIn(onUserLogin);
14429
14441
  }, onCookieError);
14430
14442
  };
14431
- const handleSSOLogin = () => {
14432
- const onSuccess = (authEndpoint) => {
14433
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
14434
- window.location.replace(authUrl);
14435
- };
14436
- const onError = () => onAuthenticationFailure('login-failed');
14437
- getSSOAuthorizationEndpoint(onSuccess, onError);
14438
- };
14439
14443
  const handleMagicLinkRequest = (token, onReturn, backgroundImage, currentPage, clientBody, email = '') => {
14440
14444
  if (!email) {
14441
14445
  const mailMagic = document.querySelector('#mail-magic');
@@ -14629,9 +14633,6 @@ var juxWeb = (function (exports) {
14629
14633
  if (loginTypes.includes('Email')) {
14630
14634
  section.appendChild(loginButton('Email', () => onEmailLoginRequest(clientApp, loginPage, onUserLogin, backgroundImg, loginTypes)));
14631
14635
  }
14632
- if (loginTypes.includes('SSO')) {
14633
- section.appendChild(loginButton('SSO', () => handleSSOLogin()));
14634
- }
14635
14636
  };
14636
14637
  const loginPage = (clientApp, backgroundImg, onUserLogin, loginTypes) => {
14637
14638
  const content = [];
@@ -3,5 +3,4 @@ export declare const onTokenAcquired: (token: string, onUserLogin: any) => void;
3
3
  export declare const initSession: (clientApp: HTMLElement, supportedLoginTypes: string[], onUserLogin: any, backgroundImage: string, fetchUserBackendUrl: any, magicLinkRequestEndpoint: string | null, magicLinkAuthEndpoint: string | null) => void;
4
4
  export declare const onMicrosoftSignIn: (onUserLogin: any) => Promise<void>;
5
5
  export declare const onGoogleSignIn: (onUserLogin: any) => void;
6
- export declare const handleSSOLogin: () => void;
7
6
  export declare const handleMagicLinkRequest: (token: string | null, onReturn: any, backgroundImage: string, currentPage: HTMLElement, clientBody: HTMLElement, email?: string) => void;
package/dist/main.esm.js CHANGED
@@ -1024,6 +1024,14 @@ const getSSOCallbackURI = () => {
1024
1024
  const { protocol, host } = window.location;
1025
1025
  return protocol + '//' + host + '/callback';
1026
1026
  };
1027
+ const handleSSOLogin = () => {
1028
+ const onSuccess = (authEndpoint) => {
1029
+ const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1030
+ window.location.replace(authUrl);
1031
+ };
1032
+ const onError = () => onAuthenticationFailure('login-failed');
1033
+ getSSOAuthorizationEndpoint(onSuccess, onError);
1034
+ };
1027
1035
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
1028
1036
  // if (startNewDemo()) {
1029
1037
  // initDemo(setBackendToken, onAuthentication);
@@ -1066,6 +1074,10 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImag
1066
1074
  validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), () => onAuthenticationFailure('login-failed'));
1067
1075
  return;
1068
1076
  }
1077
+ if (supportedLoginTypes.includes('SSO')) {
1078
+ handleSSOLogin();
1079
+ return;
1080
+ }
1069
1081
  displayPage(clientApp, loginPage(clientApp, backgroundImage, onUserLogin, supportedLoginTypes));
1070
1082
  // validateThirdPartyCookies(initGapi, () => displayPage(Page.LOGIN));
1071
1083
  // checkMixpanel(() => mixpanel.track('View Login Page'));
@@ -1108,14 +1120,6 @@ const onGoogleSignIn = (onUserLogin) => {
1108
1120
  authSignIn(onUserLogin);
1109
1121
  }, onCookieError);
1110
1122
  };
1111
- const handleSSOLogin = () => {
1112
- const onSuccess = (authEndpoint) => {
1113
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1114
- window.location.replace(authUrl);
1115
- };
1116
- const onError = () => onAuthenticationFailure('login-failed');
1117
- getSSOAuthorizationEndpoint(onSuccess, onError);
1118
- };
1119
1123
  const handleMagicLinkRequest = (token, onReturn, backgroundImage, currentPage, clientBody, email = '') => {
1120
1124
  if (!email) {
1121
1125
  const mailMagic = document.querySelector('#mail-magic');
@@ -1309,9 +1313,6 @@ const appendLoginTypes = (loginPage, section, clientApp, onUserLogin, loginTypes
1309
1313
  if (loginTypes.includes('Email')) {
1310
1314
  section.appendChild(loginButton('Email', () => onEmailLoginRequest(clientApp, loginPage, onUserLogin, backgroundImg, loginTypes)));
1311
1315
  }
1312
- if (loginTypes.includes('SSO')) {
1313
- section.appendChild(loginButton('SSO', () => handleSSOLogin()));
1314
- }
1315
1316
  };
1316
1317
  const loginPage = (clientApp, backgroundImg, onUserLogin, loginTypes) => {
1317
1318
  const content = [];
package/dist/main.js CHANGED
@@ -1048,6 +1048,14 @@ const getSSOCallbackURI = () => {
1048
1048
  const { protocol, host } = window.location;
1049
1049
  return protocol + '//' + host + '/callback';
1050
1050
  };
1051
+ const handleSSOLogin = () => {
1052
+ const onSuccess = (authEndpoint) => {
1053
+ const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1054
+ window.location.replace(authUrl);
1055
+ };
1056
+ const onError = () => onAuthenticationFailure('login-failed');
1057
+ getSSOAuthorizationEndpoint(onSuccess, onError);
1058
+ };
1051
1059
  const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
1052
1060
  // if (startNewDemo()) {
1053
1061
  // initDemo(setBackendToken, onAuthentication);
@@ -1090,6 +1098,10 @@ const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImag
1090
1098
  validateSSOToken(ssoToken, getSSOCallbackURI(), (res) => onAuthentication(onUserLogin, res, 'SSO Authentication'), () => onAuthenticationFailure('login-failed'));
1091
1099
  return;
1092
1100
  }
1101
+ if (supportedLoginTypes.includes('SSO')) {
1102
+ handleSSOLogin();
1103
+ return;
1104
+ }
1093
1105
  displayPage(clientApp, loginPage(clientApp, backgroundImage, onUserLogin, supportedLoginTypes));
1094
1106
  // validateThirdPartyCookies(initGapi, () => displayPage(Page.LOGIN));
1095
1107
  // checkMixpanel(() => mixpanel.track('View Login Page'));
@@ -1132,14 +1144,6 @@ const onGoogleSignIn = (onUserLogin) => {
1132
1144
  authSignIn(onUserLogin);
1133
1145
  }, onCookieError);
1134
1146
  };
1135
- const handleSSOLogin = () => {
1136
- const onSuccess = (authEndpoint) => {
1137
- const authUrl = authEndpoint + `&redirect_uri=${getSSOCallbackURI()}`;
1138
- window.location.replace(authUrl);
1139
- };
1140
- const onError = () => onAuthenticationFailure('login-failed');
1141
- getSSOAuthorizationEndpoint(onSuccess, onError);
1142
- };
1143
1147
  const handleMagicLinkRequest = (token, onReturn, backgroundImage, currentPage, clientBody, email = '') => {
1144
1148
  if (!email) {
1145
1149
  const mailMagic = document.querySelector('#mail-magic');
@@ -1333,9 +1337,6 @@ const appendLoginTypes = (loginPage, section, clientApp, onUserLogin, loginTypes
1333
1337
  if (loginTypes.includes('Email')) {
1334
1338
  section.appendChild(loginButton('Email', () => onEmailLoginRequest(clientApp, loginPage, onUserLogin, backgroundImg, loginTypes)));
1335
1339
  }
1336
- if (loginTypes.includes('SSO')) {
1337
- section.appendChild(loginButton('SSO', () => handleSSOLogin()));
1338
- }
1339
1340
  };
1340
1341
  const loginPage = (clientApp, backgroundImg, onUserLogin, loginTypes) => {
1341
1342
  const content = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2024.11.12",
3
+ "version": "2024.11.19",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",