@klauswuestefeld/jux-web 2023.12.8 → 2024.2.2

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
@@ -178,8 +178,18 @@ var juxWeb = (function (exports) {
178
178
  var getApiUrl = function () { return getBackendUrl() + 'api/'; };
179
179
  var getGoogleAuthUrl = function () { return getBackendUrl() + 'auth-google?google-id-token='; };
180
180
  var getMicrosoftAuthUrl = function () { return getBackendUrl() + 'auth-microsoft?access-token='; };
181
- var getMagicAuthUrl = function () { return getBackendUrl() + 'auth-magic?token='; };
182
- var getMagicAuthReqUrl = function () { return getBackendUrl() + 'magic-link-request?email='; };
181
+ var getMagicAuthUrl = function () {
182
+ var _a;
183
+ // @ts-ignore
184
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkAuthEndpoint) || 'auth-magic';
185
+ return getBackendUrl() + endpoint + '?token=';
186
+ };
187
+ var getMagicAuthReqUrl = function () {
188
+ var _a;
189
+ // @ts-ignore
190
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
191
+ return getBackendUrl() + endpoint + '?email=';
192
+ };
183
193
  var timeout;
184
194
  var maxRetries = 20;
185
195
  var retries = 0;
@@ -14250,7 +14260,7 @@ var juxWeb = (function (exports) {
14250
14260
  Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
14251
14261
  clientApp.appendChild(page);
14252
14262
  };
14253
- var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
14263
+ var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) {
14254
14264
  // if (startNewDemo()) {
14255
14265
  // initDemo(setBackendToken, onAuthentication);
14256
14266
  // return;
@@ -14262,6 +14272,10 @@ var juxWeb = (function (exports) {
14262
14272
  }
14263
14273
  // @ts-ignore
14264
14274
  window.store.fetchUserBackendUrl = fetchUserBackendUrl;
14275
+ // @ts-ignore
14276
+ window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
14277
+ // @ts-ignore
14278
+ window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
14265
14279
  var magicToken = extractTokenFromWindowLocation('magic-link');
14266
14280
  if (magicToken) {
14267
14281
  var onOpenMagicLink_1 = function () {
@@ -1,7 +1,7 @@
1
1
  export declare const setBackendToken: (token: string) => void;
2
2
  export declare const onTokenAcquired: (token: string, onUserLogin: any) => void;
3
3
  export declare const clearSession: () => void;
4
- export declare const initSession: (clientApp: HTMLElement, supportedLoginTypes: string[], onUserLogin: any, backgroundImage: string, fetchUserBackendUrl: any) => void;
4
+ export declare const initSession: (clientApp: HTMLElement, supportedLoginTypes: string[], onUserLogin: any, backgroundImage: string, fetchUserBackendUrl: any, magicLinkRequestEndpoint: string | null, magicLinkAuthEndpoint: string | null) => void;
5
5
  export declare const onMicrosoftSignIn: (onUserLogin: any) => Promise<void>;
6
6
  export declare const onGoogleSignIn: (onUserLogin: any) => void;
7
7
  export declare const handleMagicLinkRequest: (token: string | null, onReturn: any, backgroundImage: string, currentPage: HTMLElement, clientBody: HTMLElement, email?: string) => void;
package/dist/main.esm.js CHANGED
@@ -177,8 +177,18 @@ var getBackendUrlToTry = function () { return getBackendUrl(); };
177
177
  var getApiUrl = function () { return getBackendUrl() + 'api/'; };
178
178
  var getGoogleAuthUrl = function () { return getBackendUrl() + 'auth-google?google-id-token='; };
179
179
  var getMicrosoftAuthUrl = function () { return getBackendUrl() + 'auth-microsoft?access-token='; };
180
- var getMagicAuthUrl = function () { return getBackendUrl() + 'auth-magic?token='; };
181
- var getMagicAuthReqUrl = function () { return getBackendUrl() + 'magic-link-request?email='; };
180
+ var getMagicAuthUrl = function () {
181
+ var _a;
182
+ // @ts-ignore
183
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkAuthEndpoint) || 'auth-magic';
184
+ return getBackendUrl() + endpoint + '?token=';
185
+ };
186
+ var getMagicAuthReqUrl = function () {
187
+ var _a;
188
+ // @ts-ignore
189
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
190
+ return getBackendUrl() + endpoint + '?email=';
191
+ };
182
192
  var timeout;
183
193
  var maxRetries = 20;
184
194
  var retries = 0;
@@ -930,7 +940,7 @@ var displayPage = function (clientApp, page) {
930
940
  Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
931
941
  clientApp.appendChild(page);
932
942
  };
933
- var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
943
+ var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) {
934
944
  // if (startNewDemo()) {
935
945
  // initDemo(setBackendToken, onAuthentication);
936
946
  // return;
@@ -942,6 +952,10 @@ var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgro
942
952
  }
943
953
  // @ts-ignore
944
954
  window.store.fetchUserBackendUrl = fetchUserBackendUrl;
955
+ // @ts-ignore
956
+ window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
957
+ // @ts-ignore
958
+ window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
945
959
  var magicToken = extractTokenFromWindowLocation('magic-link');
946
960
  if (magicToken) {
947
961
  var onOpenMagicLink_1 = function () {
package/dist/main.js CHANGED
@@ -201,8 +201,18 @@ var getBackendUrlToTry = function () { return getBackendUrl(); };
201
201
  var getApiUrl = function () { return getBackendUrl() + 'api/'; };
202
202
  var getGoogleAuthUrl = function () { return getBackendUrl() + 'auth-google?google-id-token='; };
203
203
  var getMicrosoftAuthUrl = function () { return getBackendUrl() + 'auth-microsoft?access-token='; };
204
- var getMagicAuthUrl = function () { return getBackendUrl() + 'auth-magic?token='; };
205
- var getMagicAuthReqUrl = function () { return getBackendUrl() + 'magic-link-request?email='; };
204
+ var getMagicAuthUrl = function () {
205
+ var _a;
206
+ // @ts-ignore
207
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkAuthEndpoint) || 'auth-magic';
208
+ return getBackendUrl() + endpoint + '?token=';
209
+ };
210
+ var getMagicAuthReqUrl = function () {
211
+ var _a;
212
+ // @ts-ignore
213
+ var endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
214
+ return getBackendUrl() + endpoint + '?email=';
215
+ };
206
216
  var timeout;
207
217
  var maxRetries = 20;
208
218
  var retries = 0;
@@ -954,7 +964,7 @@ var displayPage = function (clientApp, page) {
954
964
  Array.from(clientApp.children).forEach(function (el) { return el.remove(); });
955
965
  clientApp.appendChild(page);
956
966
  };
957
- var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl) {
967
+ var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) {
958
968
  // if (startNewDemo()) {
959
969
  // initDemo(setBackendToken, onAuthentication);
960
970
  // return;
@@ -966,6 +976,10 @@ var initSession = function (clientApp, supportedLoginTypes, onUserLogin, backgro
966
976
  }
967
977
  // @ts-ignore
968
978
  window.store.fetchUserBackendUrl = fetchUserBackendUrl;
979
+ // @ts-ignore
980
+ window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
981
+ // @ts-ignore
982
+ window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
969
983
  var magicToken = extractTokenFromWindowLocation('magic-link');
970
984
  if (magicToken) {
971
985
  var onOpenMagicLink_1 = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2023.12.08",
3
+ "version": "2024.2.2",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",