strapi-plugin-magic-link-v5 5.3.9 → 5.3.10

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.
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
5
5
  import { Flex, Loader, Box, Typography, Button, TextInput, Badge } from "@strapi/design-system";
6
6
  import { Phone, Check, Message, ArrowClockwise } from "@strapi/icons";
7
7
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
8
- import { g as getTrad } from "./index-Z1X4GMXV.mjs";
8
+ import { g as getTrad } from "./index-Bz3ongJV.mjs";
9
9
  const theme = {
10
10
  colors: {
11
11
  primary: { 700: "#075985", 100: "#E0F2FE", 50: "#F0F9FF" },
@@ -59,7 +59,7 @@ const index = {
59
59
  },
60
60
  Component: () => import(
61
61
  /* webpackChunkName: "magic-link-tokens" */
62
- "./index-DSqOwGld.mjs"
62
+ "./index-C0X9UUM3.mjs"
63
63
  ),
64
64
  permissions: []
65
65
  // Leeres Array = keine Permission-Prüfung nötig
@@ -82,7 +82,7 @@ const index = {
82
82
  to: `${PLUGIN_ID}/config`,
83
83
  Component: () => import(
84
84
  /* webpackChunkName: "magic-link-settings" */
85
- "./index-HXipepeY.mjs"
85
+ "./index-DqlWCjQK.mjs"
86
86
  ),
87
87
  permissions: pluginPermissions.readSettings
88
88
  },
@@ -121,7 +121,7 @@ const index = {
121
121
  to: `${PLUGIN_ID}/whatsapp`,
122
122
  Component: () => import(
123
123
  /* webpackChunkName: "magic-link-whatsapp" */
124
- "./index-nzjaxE_3.mjs"
124
+ "./index-BTtMnG6G.mjs"
125
125
  ),
126
126
  permissions: []
127
127
  }
@@ -5,7 +5,7 @@ import styled, { keyframes, css } from "styled-components";
5
5
  import { useIntl } from "react-intl";
6
6
  import { Box, Flex, Typography, Button, TextInput, Textarea, Checkbox, IconButton, Loader, Searchbar, SingleSelect, SingleSelectOption, Thead, Tr, Th, Tbody, Td, Pagination, PreviousLink, PageLink, NextLink, Table, Badge, VisuallyHidden, Main } from "@strapi/design-system";
7
7
  import { Cross, Sparkle, Check, Shield, Clock, Lock, Trash, ArrowClockwise, CaretDown, User, Monitor, Calendar, Plus, Earth, WarningCircle, Server, Eye, Mail, Cog, Key, Link } from "@strapi/icons";
8
- import { g as getTrad, P as PLUGIN_ID } from "./index-Z1X4GMXV.mjs";
8
+ import { g as getTrad, P as PLUGIN_ID } from "./index-Bz3ongJV.mjs";
9
9
  import { useFetchClient, useNotification } from "@strapi/strapi/admin";
10
10
  import { L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-B_r3b1Vh.mjs";
11
11
  const CreateTokenModal = ({ isOpen, onClose, onSubmit, formData, setFormData }) => {
@@ -3668,6 +3668,7 @@ const TokensProfessional = () => {
3668
3668
  const [pageSize, setPageSize] = useState(10);
3669
3669
  const [sortBy, setSortBy] = useState("createdAt");
3670
3670
  const [sortOrder, setSortOrder] = useState("desc");
3671
+ const [defaultTtlHours, setDefaultTtlHours] = useState(24);
3671
3672
  const [newToken, setNewToken] = useState({
3672
3673
  email: "",
3673
3674
  ttl: 24,
@@ -3788,6 +3789,20 @@ const TokensProfessional = () => {
3788
3789
  }, [get, toggleNotification]);
3789
3790
  useEffect(() => {
3790
3791
  fetchTokens();
3792
+ const loadDefaultTtl = async () => {
3793
+ try {
3794
+ const res = await get("/magic-link/settings");
3795
+ const settingsData = res?.data?.settings || res?.data?.data || res?.data;
3796
+ if (settingsData?.expire_period) {
3797
+ const hours = Math.max(1, Math.round(Number(settingsData.expire_period) / 3600));
3798
+ setDefaultTtlHours(hours);
3799
+ setNewToken((prev) => ({ ...prev, ttl: hours }));
3800
+ }
3801
+ } catch (err) {
3802
+ console.error("Error loading settings for default TTL:", err);
3803
+ }
3804
+ };
3805
+ loadDefaultTtl();
3791
3806
  }, [fetchTokens]);
3792
3807
  const handleRefresh = () => {
3793
3808
  fetchTokens();
@@ -3856,7 +3871,7 @@ const TokensProfessional = () => {
3856
3871
  const createdToken = response?.data;
3857
3872
  await fetchTokens();
3858
3873
  setShowCreateModal(false);
3859
- setNewToken({ email: "", ttl: 24, context: {}, sendEmail: true });
3874
+ setNewToken({ email: "", ttl: defaultTtlHours, context: {}, sendEmail: true });
3860
3875
  setSearchQuery("");
3861
3876
  if (createdToken && createdToken.token) {
3862
3877
  setCreatedTokenData({
@@ -7,7 +7,7 @@ const reactIntl = require("react-intl");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const admin = require("@strapi/strapi/admin");
10
- const index = require("./index-Ddh0lQxN.js");
10
+ const index = require("./index-Fq4vgM9i.js");
11
11
  const LicenseGuard = require("./LicenseGuard-BEEd9IpN.js");
12
12
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
13
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
@@ -7,7 +7,7 @@ const styled = require("styled-components");
7
7
  const reactIntl = require("react-intl");
8
8
  const designSystem = require("@strapi/design-system");
9
9
  const icons = require("@strapi/icons");
10
- const index = require("./index-Ddh0lQxN.js");
10
+ const index = require("./index-Fq4vgM9i.js");
11
11
  const admin = require("@strapi/strapi/admin");
12
12
  const LicenseGuard = require("./LicenseGuard-BEEd9IpN.js");
13
13
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
@@ -3672,6 +3672,7 @@ const TokensProfessional = () => {
3672
3672
  const [pageSize, setPageSize] = react.useState(10);
3673
3673
  const [sortBy, setSortBy] = react.useState("createdAt");
3674
3674
  const [sortOrder, setSortOrder] = react.useState("desc");
3675
+ const [defaultTtlHours, setDefaultTtlHours] = react.useState(24);
3675
3676
  const [newToken, setNewToken] = react.useState({
3676
3677
  email: "",
3677
3678
  ttl: 24,
@@ -3792,6 +3793,20 @@ const TokensProfessional = () => {
3792
3793
  }, [get, toggleNotification]);
3793
3794
  react.useEffect(() => {
3794
3795
  fetchTokens();
3796
+ const loadDefaultTtl = async () => {
3797
+ try {
3798
+ const res = await get("/magic-link/settings");
3799
+ const settingsData = res?.data?.settings || res?.data?.data || res?.data;
3800
+ if (settingsData?.expire_period) {
3801
+ const hours = Math.max(1, Math.round(Number(settingsData.expire_period) / 3600));
3802
+ setDefaultTtlHours(hours);
3803
+ setNewToken((prev) => ({ ...prev, ttl: hours }));
3804
+ }
3805
+ } catch (err) {
3806
+ console.error("Error loading settings for default TTL:", err);
3807
+ }
3808
+ };
3809
+ loadDefaultTtl();
3795
3810
  }, [fetchTokens]);
3796
3811
  const handleRefresh = () => {
3797
3812
  fetchTokens();
@@ -3860,7 +3875,7 @@ const TokensProfessional = () => {
3860
3875
  const createdToken = response?.data;
3861
3876
  await fetchTokens();
3862
3877
  setShowCreateModal(false);
3863
- setNewToken({ email: "", ttl: 24, context: {}, sendEmail: true });
3878
+ setNewToken({ email: "", ttl: defaultTtlHours, context: {}, sendEmail: true });
3864
3879
  setSearchQuery("");
3865
3880
  if (createdToken && createdToken.token) {
3866
3881
  setCreatedTokenData({
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
5
5
  import { Box, Typography, Flex, Button, Accordion, SingleSelect, SingleSelectOption, Grid, Switch, NumberInput, TextInput, Divider, Textarea, Badge } from "@strapi/design-system";
6
6
  import { Check, Cog, Lightning, Shield, Mail, CheckCircle, Code, Link, Lock, Key } from "@strapi/icons";
7
7
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
8
- import { g as getTrad } from "./index-Z1X4GMXV.mjs";
8
+ import { g as getTrad } from "./index-Bz3ongJV.mjs";
9
9
  import { u as usePluginLanguage, L as LicenseGuard, a as LanguageProvider } from "./LicenseGuard-B_r3b1Vh.mjs";
10
10
  const EMAIL_TEMPLATES = {
11
11
  modern: {
@@ -7,7 +7,7 @@ const reactIntl = require("react-intl");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const admin = require("@strapi/strapi/admin");
10
- const index = require("./index-Ddh0lQxN.js");
10
+ const index = require("./index-Fq4vgM9i.js");
11
11
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
12
12
  const styled__default = /* @__PURE__ */ _interopDefault(styled);
13
13
  const theme = {
@@ -60,7 +60,7 @@ const index = {
60
60
  },
61
61
  Component: () => Promise.resolve().then(() => require(
62
62
  /* webpackChunkName: "magic-link-tokens" */
63
- "./index-ClkHQjro.js"
63
+ "./index-DTcLx4mc.js"
64
64
  )),
65
65
  permissions: []
66
66
  // Leeres Array = keine Permission-Prüfung nötig
@@ -83,7 +83,7 @@ const index = {
83
83
  to: `${PLUGIN_ID}/config`,
84
84
  Component: () => Promise.resolve().then(() => require(
85
85
  /* webpackChunkName: "magic-link-settings" */
86
- "./index-Dno_sLco.js"
86
+ "./index-DGIjZE-h.js"
87
87
  )),
88
88
  permissions: pluginPermissions.readSettings
89
89
  },
@@ -122,7 +122,7 @@ const index = {
122
122
  to: `${PLUGIN_ID}/whatsapp`,
123
123
  Component: () => Promise.resolve().then(() => require(
124
124
  /* webpackChunkName: "magic-link-whatsapp" */
125
- "./index-BTazJCLp.js"
125
+ "./index-Due3crFC.js"
126
126
  )),
127
127
  permissions: []
128
128
  }
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-Ddh0lQxN.js");
2
+ const index = require("../_chunks/index-Fq4vgM9i.js");
3
3
  require("@strapi/icons");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-Z1X4GMXV.mjs";
1
+ import { i } from "../_chunks/index-Bz3ongJV.mjs";
2
2
  import "@strapi/icons";
3
3
  export {
4
4
  i as default
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.3.9",
2
+ "version": "5.3.10",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {