@churchapps/apphelper 0.3.12 → 0.3.13
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/pageComponents/components/LoginSetPassword.d.ts.map +1 -1
- package/dist/pageComponents/components/LoginSetPassword.js +29 -7
- package/dist/pageComponents/components/LoginSetPassword.js.map +1 -1
- package/dist/public/locales/en.json +2 -0
- package/package.json +1 -1
- package/public/locales/en.json +2 -0
- package/src/pageComponents/components/LoginSetPassword.tsx +39 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginSetPassword.d.ts","sourceRoot":"","sources":["../../../src/pageComponents/components/LoginSetPassword.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"LoginSetPassword.d.ts","sourceRoot":"","sources":["../../../src/pageComponents/components/LoginSetPassword.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+E5C,CAAA"}
|
|
@@ -44,6 +44,7 @@ const LoginSetPassword = props => {
|
|
|
44
44
|
const [verifyPassword, setVerifyPassword] = react_1.default.useState("");
|
|
45
45
|
const [user, setUser] = react_1.default.useState(null);
|
|
46
46
|
const [showPassword, setShowPassword] = (0, react_1.useState)(false);
|
|
47
|
+
const [linkExpired, setLinkExpired] = react_1.default.useState(false);
|
|
47
48
|
const validate = () => {
|
|
48
49
|
const result = [];
|
|
49
50
|
if (!password)
|
|
@@ -56,7 +57,10 @@ const LoginSetPassword = props => {
|
|
|
56
57
|
return result.length === 0;
|
|
57
58
|
};
|
|
58
59
|
const submitChangePassword = () => {
|
|
59
|
-
if (
|
|
60
|
+
if (linkExpired) {
|
|
61
|
+
window.open("/login", "_blank");
|
|
62
|
+
}
|
|
63
|
+
else if (validate()) {
|
|
60
64
|
submit();
|
|
61
65
|
}
|
|
62
66
|
};
|
|
@@ -78,12 +82,30 @@ const LoginSetPassword = props => {
|
|
|
78
82
|
else
|
|
79
83
|
props.setShowForgot(true);
|
|
80
84
|
});
|
|
81
|
-
react_1.default.useEffect(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
react_1.default.useEffect(() => {
|
|
86
|
+
//Get the timestamp from the URL
|
|
87
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
88
|
+
const timestampParam = urlParams.get("timestamp");
|
|
89
|
+
if (timestampParam) {
|
|
90
|
+
const linkTimestamp = parseInt(timestampParam, 10);
|
|
91
|
+
const currentTime = Date.now();
|
|
92
|
+
//Check if the link is expired (2 min)
|
|
93
|
+
if (currentTime - linkTimestamp > 120000) {
|
|
94
|
+
setLinkExpired(true);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
loadUser();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
setLinkExpired(true); //No timestamp means link is invalid
|
|
102
|
+
}
|
|
103
|
+
}, []);
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)(components_1.InputBox, { headerText: helpers_1.Locale.label("login.setPassword"), saveFunction: submitChangePassword, saveButtonType: "submit", saveText: !linkExpired ? (props.isSubmitting || !user) ? helpers_1.Locale.label("common.pleaseWait") : helpers_1.Locale.label("login.signIn") : helpers_1.Locale.label("login.requestLink"), isSubmitting: props.isSubmitting, children: linkExpired ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: "#c62828 !important", paddingBottom: 3 }, children: helpers_1.Locale.label("login.expiredLink") }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [user && (0, jsx_runtime_1.jsxs)("p", { style: { marginTop: 0, marginBottom: 0 }, children: [helpers_1.Locale.label("login.welcomeBack"), " ", user.firstName, "."] }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, name: "password", type: showPassword ? "text" : "password", label: helpers_1.Locale.label("login.setPassword"), value: password, onChange: (e) => { e.preventDefault(); setPassword(e.target.value); }, InputProps: {
|
|
105
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "toggle password visibility", onClick: () => { setShowPassword(!showPassword); }, children: showPassword ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "visibility" }) : (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "visibility_off" }) }) }))
|
|
106
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, name: "verifyPassword", type: showPassword ? "text" : "password", label: helpers_1.Locale.label("login.verifyPassword"), value: verifyPassword, onChange: (e) => { e.preventDefault(); setVerifyPassword(e.target.value); }, InputProps: {
|
|
107
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "aria-label": "toggle password visibility", onClick: () => { setShowPassword(!showPassword); }, children: showPassword ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "visibility" }) : (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "visibility_off" }) }) }))
|
|
108
|
+
} })] })) }));
|
|
87
109
|
};
|
|
88
110
|
exports.LoginSetPassword = LoginSetPassword;
|
|
89
111
|
//# sourceMappingURL=LoginSetPassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginSetPassword.js","sourceRoot":"","sources":["../../../src/pageComponents/components/LoginSetPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAwC;AACxC,iDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"LoginSetPassword.js","sourceRoot":"","sources":["../../../src/pageComponents/components/LoginSetPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+CAAwC;AACxC,iDAA4C;AAC5C,4CAAwF;AAExF,2CAAkD;AAY3C,MAAM,gBAAgB,GAAoB,KAAK,CAAC,EAAE;IACvD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gB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AC,yBAAc,IAAC,QAAQ,EAAC,KAAK,YAAC,uBAAC,qBAAU,kBAAY,4BAA4B,EAAC,OAAO,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,CAAC,YAAY,CAAC,CAAA,CAAC,CAAC,YAAG,YAAY,CAAC,CAAC,CAAC,uBAAC,eAAI,6BAAkB,CAAC,CAAC,CAAC,uBAAC,eAAI,iCAAsB,GAAc,GAAiB,CAAC;qBAC3P,GAAI,EACL,uBAAC,oBAAS,IAAC,SAAS,QAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,gBAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,EAAG,UAAU,EAAE;wBAChP,YAAY,EAAE,CAAC,uBAAC,yBAAc,IAAC,QAAQ,EAAC,KAAK,YAAC,uBAAC,qBAAU,kBAAY,4BAA4B,EAAC,OAAO,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,CAAC,YAAY,CAAC,CAAA,CAAC,CAAC,YAAG,YAAY,CAAC,CAAC,CAAC,uBAAC,eAAI,6BAAkB,CAAC,CAAC,CAAC,uBAAC,eAAI,iCAAsB,GAAc,GAAiB,CAAC;qBAC3P,GAAI,IACJ,CACJ,GACQ,CACZ,CAAC;AACJ,CAAC,CAAA;AA/EY,QAAA,gBAAgB,oBA+E5B"}
|
|
@@ -153,12 +153,14 @@
|
|
|
153
153
|
"login": {
|
|
154
154
|
"createAccount": "Create an Account",
|
|
155
155
|
"email": "Email",
|
|
156
|
+
"expiredLink": "The current link is expired.",
|
|
156
157
|
"forgot": "Forgot Password",
|
|
157
158
|
"goLogin": "Go to Login",
|
|
158
159
|
"login": "Login",
|
|
159
160
|
"password": "Password",
|
|
160
161
|
"register": "Register",
|
|
161
162
|
"registerThankYou": "Thank you for registering! Please check your email to verify your account.",
|
|
163
|
+
"requestLink": "Request a new reset link",
|
|
162
164
|
"reset": "Reset",
|
|
163
165
|
"resetInstructions": "Enter your email address to request a password reset.",
|
|
164
166
|
"resetPassword": "Reset Password",
|
package/package.json
CHANGED
package/public/locales/en.json
CHANGED
|
@@ -153,12 +153,14 @@
|
|
|
153
153
|
"login": {
|
|
154
154
|
"createAccount": "Create an Account",
|
|
155
155
|
"email": "Email",
|
|
156
|
+
"expiredLink": "The current link is expired.",
|
|
156
157
|
"forgot": "Forgot Password",
|
|
157
158
|
"goLogin": "Go to Login",
|
|
158
159
|
"login": "Login",
|
|
159
160
|
"password": "Password",
|
|
160
161
|
"register": "Register",
|
|
161
162
|
"registerThankYou": "Thank you for registering! Please check your email to verify your account.",
|
|
163
|
+
"requestLink": "Request a new reset link",
|
|
162
164
|
"reset": "Reset",
|
|
163
165
|
"resetInstructions": "Enter your email address to request a password reset.",
|
|
164
166
|
"resetPassword": "Reset Password",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useState } from "react";
|
|
4
4
|
import { InputBox } from "../../components";
|
|
5
|
-
import { Icon, IconButton, InputAdornment, TextField } from "@mui/material";
|
|
5
|
+
import { Icon, IconButton, InputAdornment, TextField, Typography } from "@mui/material";
|
|
6
6
|
import { LoginResponseInterface, UserInterface } from "@churchapps/helpers";
|
|
7
7
|
import { ApiHelper, Locale } from "../../helpers";
|
|
8
8
|
|
|
@@ -21,6 +21,7 @@ export const LoginSetPassword: React.FC<Props> = props => {
|
|
|
21
21
|
const [verifyPassword, setVerifyPassword] = React.useState("");
|
|
22
22
|
const [user, setUser] = React.useState<UserInterface>(null);
|
|
23
23
|
const [showPassword, setShowPassword] = useState(false);
|
|
24
|
+
const [linkExpired, setLinkExpired] = React.useState(false);
|
|
24
25
|
|
|
25
26
|
const validate = () => {
|
|
26
27
|
const result = [];
|
|
@@ -32,7 +33,9 @@ export const LoginSetPassword: React.FC<Props> = props => {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const submitChangePassword = () => {
|
|
35
|
-
if (
|
|
36
|
+
if (linkExpired) {
|
|
37
|
+
window.open("/login", "_blank");
|
|
38
|
+
} else if (validate()) {
|
|
36
39
|
submit();
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -54,17 +57,42 @@ export const LoginSetPassword: React.FC<Props> = props => {
|
|
|
54
57
|
else props.setShowForgot(true);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
React.useEffect(
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
//Get the timestamp from the URL
|
|
62
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
63
|
+
const timestampParam = urlParams.get("timestamp");
|
|
64
|
+
if (timestampParam) {
|
|
65
|
+
const linkTimestamp = parseInt(timestampParam, 10);
|
|
66
|
+
const currentTime = Date.now();
|
|
67
|
+
|
|
68
|
+
//Check if the link is expired (2 min)
|
|
69
|
+
if (currentTime - linkTimestamp > 120000) {
|
|
70
|
+
setLinkExpired(true);
|
|
71
|
+
} else {
|
|
72
|
+
loadUser();
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
setLinkExpired(true); //No timestamp means link is invalid
|
|
76
|
+
}
|
|
77
|
+
}, []);
|
|
58
78
|
|
|
59
79
|
return (
|
|
60
|
-
<InputBox headerText={Locale.label("login.setPassword")} saveFunction={submitChangePassword} saveButtonType="submit" saveText={(props.isSubmitting || !user) ? Locale.label("common.pleaseWait") : Locale.label("login.signIn")} isSubmitting={props.isSubmitting}>
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
80
|
+
<InputBox headerText={Locale.label("login.setPassword")} saveFunction={submitChangePassword} saveButtonType="submit" saveText={!linkExpired ? (props.isSubmitting || !user) ? Locale.label("common.pleaseWait") : Locale.label("login.signIn") : Locale.label("login.requestLink")} isSubmitting={props.isSubmitting}>
|
|
81
|
+
{linkExpired ? (
|
|
82
|
+
<>
|
|
83
|
+
<Typography sx={{ color: "#c62828 !important", paddingBottom: 3 }}>{Locale.label("login.expiredLink")}</Typography>
|
|
84
|
+
</>
|
|
85
|
+
) : (
|
|
86
|
+
<>
|
|
87
|
+
{user && <p style={{ marginTop: 0, marginBottom: 0 }}>{Locale.label("login.welcomeBack")} {user.firstName}.</p>}
|
|
88
|
+
<TextField fullWidth name="password" type={showPassword ? "text" : "password"} label={Locale.label("login.setPassword")} value={password} onChange={(e) => { e.preventDefault(); setPassword(e.target.value) }} InputProps={{
|
|
89
|
+
endAdornment: (<InputAdornment position="end"><IconButton aria-label="toggle password visibility" onClick={() => { setShowPassword(!showPassword) }}>{showPassword ? <Icon>visibility</Icon> : <Icon>visibility_off</Icon>}</IconButton></InputAdornment>)
|
|
90
|
+
}} />
|
|
91
|
+
<TextField fullWidth name="verifyPassword" type={showPassword ? "text" : "password"} label={Locale.label("login.verifyPassword")} value={verifyPassword} onChange={(e) => { e.preventDefault(); setVerifyPassword(e.target.value) }} InputProps={{
|
|
92
|
+
endAdornment: (<InputAdornment position="end"><IconButton aria-label="toggle password visibility" onClick={() => { setShowPassword(!showPassword) }}>{showPassword ? <Icon>visibility</Icon> : <Icon>visibility_off</Icon>}</IconButton></InputAdornment>)
|
|
93
|
+
}} />
|
|
94
|
+
</>
|
|
95
|
+
)}
|
|
68
96
|
</InputBox>
|
|
69
97
|
);
|
|
70
98
|
}
|