@schukai/monster 4.50.0 → 4.51.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [4.51.0] - 2025-12-25
6
+
7
+ ### Add Features
8
+
9
+ - Enhance success URL handling in login component
10
+
11
+
12
+
5
13
  ## [4.50.0] - 2025-12-21
6
14
 
7
15
  ### Add Features
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.50.0"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.7.4","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"4.51.0"}
@@ -34,6 +34,8 @@ import "./digits.mjs";
34
34
  import "../layout/collapse.mjs";
35
35
  import "../datatable/datasource/rest.mjs";
36
36
 
37
+ import { isArray, isString, isObject, isFunction } from "../../types/is.mjs";
38
+
37
39
  import { InvalidStyleSheet } from "./stylesheet/invalid.mjs";
38
40
  import { getLocaleOfDocument } from "../../dom/locale.mjs";
39
41
  import { getWindow } from "../../dom/util.mjs";
@@ -439,11 +441,22 @@ class Login extends CustomElement {
439
441
  fireEvent(this, "redirect-to-first-success-url");
440
442
 
441
443
  const successUrl = this.getOption("successUrls");
442
- if (successUrl.length > 0) {
444
+ if (isArray(successUrl) && successUrl.length > 0) {
443
445
  const success = successUrl[0].url;
444
446
  if (success) {
445
447
  getWindow().location.href = success;
446
448
  }
449
+ } else if (isFunction(successUrl)) {
450
+ const url = successUrl();
451
+ if (url) {
452
+ getWindow().location.href = url;
453
+ }
454
+ } else if (isString(successUrl)) {
455
+ getWindow().location.href = successUrl;
456
+ } else {
457
+ console.warn(
458
+ "[Monster Login] No valid success URL found for redirection.",
459
+ );
447
460
  }
448
461
  }, this.getOption("timeoutForSuccess"));
449
462