@faststore/core 3.75.0 → 3.75.1
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/account/security.js +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → XwA54nEAB8pJ6ThhQE-WK}/_buildManifest.js +1 -1
- package/.next/static/chunks/pages/account/security-7d12dd7a4ca973e6.js +1 -0
- package/.next/trace +134 -134
- package/.turbo/turbo-build.log +8 -8
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/components/account/security/SecurityDrawer.tsx +2 -6
- package/src/sdk/account/useSetPassword.ts +59 -48
- package/.next/static/chunks/pages/account/security-8ea4d1e2aba1bfb7.js +0 -1
- /package/.next/static/{hFo9Wcpbmu-Dxoo5xhC5c → XwA54nEAB8pJ6ThhQE-WK}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.75.0 prebuild /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> na run partytown && na run generate
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @faststore/core@3.
|
|
6
|
+
> @faststore/core@3.75.0 partytown /home/runner/work/faststore/faststore/packages/core
|
|
7
7
|
> partytown copylib ./public/~partytown
|
|
8
8
|
|
|
9
9
|
Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
|
|
10
10
|
|
|
11
|
-
> @faststore/core@3.
|
|
11
|
+
> @faststore/core@3.75.0 generate /home/runner/work/faststore/faststore/packages/core
|
|
12
12
|
> na run generate:schema && na run generate:codegen && na run format:generated
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
> @faststore/core@3.
|
|
15
|
+
> @faststore/core@3.75.0 generate:schema /home/runner/work/faststore/faststore/packages/core
|
|
16
16
|
> tsx src/server/generator/generateGraphQLSchemaFile.ts
|
|
17
17
|
|
|
18
18
|
Schema GraphQL file generated successfully
|
|
19
19
|
|
|
20
|
-
> @faststore/core@3.
|
|
20
|
+
> @faststore/core@3.75.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
|
|
21
21
|
> graphql-codegen
|
|
22
22
|
|
|
23
23
|
[STARTED] Parse Configuration
|
|
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
|
|
|
37
37
|
[CLI] Loading Documents
|
|
38
38
|
[CLI] Generating output
|
|
39
39
|
|
|
40
|
-
> @faststore/core@3.
|
|
40
|
+
> @faststore/core@3.75.0 format:generated /home/runner/work/faststore/faststore/packages/core
|
|
41
41
|
> prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
> @faststore/core@3.
|
|
44
|
+
> @faststore/core@3.75.0 build /home/runner/work/faststore/faststore/packages/core
|
|
45
45
|
> next build
|
|
46
46
|
|
|
47
47
|
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
|
|
@@ -95,7 +95,7 @@ Route (pages) Size First Load JS
|
|
|
95
95
|
├ └ css/70353bf19c496790.css 12.6 kB
|
|
96
96
|
├ λ /account/profile 1.79 kB 138 kB
|
|
97
97
|
├ └ css/831a1f72fe4b2d80.css 3.97 kB
|
|
98
|
-
├ λ /account/security 3.
|
|
98
|
+
├ λ /account/security 3.76 kB 140 kB
|
|
99
99
|
├ └ css/ec7fdad03808422d.css 5.22 kB
|
|
100
100
|
├ λ /account/user-details 1.74 kB 138 kB
|
|
101
101
|
├ └ css/e46393a76c5d93a9.css 4.17 kB
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @faststore/core@3.
|
|
2
|
+
> @faststore/core@3.75.0 test /home/runner/work/faststore/faststore/packages/core
|
|
3
3
|
> jest
|
|
4
4
|
|
|
5
|
-
PASS test/server/cms/global.test.ts (
|
|
6
|
-
PASS test/utils/multipleTemplates.test.ts (
|
|
5
|
+
PASS test/server/cms/global.test.ts (26.209 s)
|
|
6
|
+
PASS test/utils/multipleTemplates.test.ts (26.471 s)
|
|
7
7
|
PASS test/server/cms/index.test.ts
|
|
8
|
-
PASS test/server/index.test.ts (
|
|
8
|
+
PASS test/server/index.test.ts (29.832 s)
|
|
9
9
|
|
|
10
10
|
Test Suites: 4 passed, 4 total
|
|
11
11
|
Tests: 22 passed, 22 total
|
|
12
12
|
Snapshots: 0 total
|
|
13
|
-
Time:
|
|
13
|
+
Time: 31.094 s
|
|
14
14
|
Ran all test suites.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.75.1](https://github.com/vtex/faststore/compare/v3.75.0...v3.75.1) (2025-08-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/core
|
|
9
|
+
|
|
6
10
|
# [3.75.0](https://github.com/vtex/faststore/compare/v3.74.0...v3.75.0) (2025-08-07)
|
|
7
11
|
|
|
8
12
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.75.
|
|
3
|
+
"version": "3.75.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"ts-jest": "29.1.1",
|
|
109
109
|
"typescript": "5.3.2"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "7214b5421dd81cb06903c4f6d202493039085a76"
|
|
112
112
|
}
|
|
@@ -44,7 +44,7 @@ export const SecurityDrawer = ({
|
|
|
44
44
|
|
|
45
45
|
const [formError, setFormError] = useState<string | null>(null)
|
|
46
46
|
|
|
47
|
-
const { setPassword, loading
|
|
47
|
+
const { setPassword, loading } = useSetPassword(accountName)
|
|
48
48
|
|
|
49
49
|
const newPasswordValidations = validations.map((rule) => ({
|
|
50
50
|
label: rule.label,
|
|
@@ -85,15 +85,11 @@ export const SecurityDrawer = ({
|
|
|
85
85
|
newPassword,
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
if (error) {
|
|
89
|
-
throw error
|
|
90
|
-
}
|
|
91
|
-
|
|
92
88
|
if (!data.success) {
|
|
93
89
|
pushToast({
|
|
94
90
|
title: 'Error setting password',
|
|
95
91
|
status: 'ERROR',
|
|
96
|
-
message:
|
|
92
|
+
message: data.message,
|
|
97
93
|
icon: <Icon width={30} height={30} name="CircleWavyWarning" />,
|
|
98
94
|
})
|
|
99
95
|
|
|
@@ -11,24 +11,36 @@ type SetPasswordInput = {
|
|
|
11
11
|
recaptcha?: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type SetPasswordState = {
|
|
15
|
-
error: Error | null
|
|
16
|
-
loading: boolean
|
|
17
|
-
}
|
|
18
|
-
|
|
19
14
|
type SetPasswordResultType = {
|
|
20
15
|
authStatus?: string
|
|
21
16
|
message?: string
|
|
22
17
|
}
|
|
23
18
|
|
|
19
|
+
const AUTH_STATUS = {
|
|
20
|
+
SUCCESS: 'success',
|
|
21
|
+
INVALID_EMAIL: 'invalidemail',
|
|
22
|
+
INVALID_PASSWORD: 'invalidpassword',
|
|
23
|
+
WRONG_CREDENTIALS: 'wrongcredentials',
|
|
24
|
+
UNEXPECTED_ERROR: 'unexpectederror',
|
|
25
|
+
NO_RESPONSE: 'noresponse',
|
|
26
|
+
FAILED: 'failed',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const authMessage = {
|
|
30
|
+
[AUTH_STATUS.SUCCESS]: 'Password set successfully',
|
|
31
|
+
[AUTH_STATUS.INVALID_EMAIL]: 'Invalid email or password',
|
|
32
|
+
[AUTH_STATUS.INVALID_PASSWORD]: 'Invalid email or password',
|
|
33
|
+
[AUTH_STATUS.WRONG_CREDENTIALS]: 'Wrong credentials',
|
|
34
|
+
[AUTH_STATUS.UNEXPECTED_ERROR]: 'Unexpected error. Please try again later.',
|
|
35
|
+
[AUTH_STATUS.NO_RESPONSE]: 'No response from set password API',
|
|
36
|
+
[AUTH_STATUS.FAILED]: 'Failed to set password',
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
export const useSetPassword = (accountName?: string) => {
|
|
25
|
-
const [
|
|
26
|
-
error: null,
|
|
27
|
-
loading: false,
|
|
28
|
-
})
|
|
40
|
+
const [loading, setLoading] = useState<boolean>(false)
|
|
29
41
|
|
|
30
42
|
const setPassword = useCallback(async (input: SetPasswordInput) => {
|
|
31
|
-
|
|
43
|
+
setLoading(true)
|
|
32
44
|
|
|
33
45
|
try {
|
|
34
46
|
await startLogin({ email: input.userEmail, accountName })
|
|
@@ -51,66 +63,62 @@ export const useSetPassword = (accountName?: string) => {
|
|
|
51
63
|
)
|
|
52
64
|
|
|
53
65
|
if (!response.ok) {
|
|
54
|
-
|
|
55
|
-
`Failed to set password: ${response.status} ${response.statusText}`
|
|
56
|
-
)
|
|
57
|
-
}
|
|
66
|
+
setLoading(false)
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
authStatus: 'Unexpected error',
|
|
61
|
-
message: 'Unexpected error while setting password',
|
|
62
|
-
}
|
|
68
|
+
console.error('Set password request failed:', response.statusText)
|
|
63
69
|
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
let errorStatus = AUTH_STATUS.UNEXPECTED_ERROR
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const errorBody = await response.json()
|
|
74
|
+
if (errorBody?.authStatus) {
|
|
75
|
+
errorStatus = String(errorBody.authStatus).toLowerCase().trim()
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// Keep the default error
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
66
82
|
success: false,
|
|
67
|
-
message:
|
|
83
|
+
message: authMessage[errorStatus],
|
|
68
84
|
}
|
|
85
|
+
}
|
|
69
86
|
|
|
70
|
-
|
|
87
|
+
const result: SetPasswordResultType = await response.json()
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
if (!result) {
|
|
90
|
+
setLoading(false)
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
success: false,
|
|
94
|
+
message: authMessage[AUTH_STATUS.NO_RESPONSE],
|
|
95
|
+
}
|
|
73
96
|
}
|
|
74
97
|
|
|
75
|
-
|
|
98
|
+
const authStatus = result?.authStatus?.toLowerCase().trim() ?? ''
|
|
76
99
|
|
|
77
100
|
return {
|
|
78
|
-
success:
|
|
79
|
-
|
|
80
|
-
: false,
|
|
81
|
-
message: 'Password set successfully',
|
|
101
|
+
success: authStatus === AUTH_STATUS.SUCCESS,
|
|
102
|
+
message: authMessage[authStatus] || 'Unexpected error occurred',
|
|
82
103
|
}
|
|
83
104
|
} catch (err) {
|
|
84
105
|
console.error('Error setting password:', err)
|
|
85
106
|
|
|
86
107
|
const authStatus =
|
|
87
108
|
typeof err === 'object' && err !== null && 'authStatus' in err
|
|
88
|
-
? String(err.authStatus)
|
|
89
|
-
:
|
|
90
|
-
|
|
91
|
-
const isInvalidCredentials =
|
|
92
|
-
authStatus.toLowerCase().includes('invalidemail') ||
|
|
93
|
-
authStatus.toLowerCase().includes('invalidpassword')
|
|
109
|
+
? String(err.authStatus).toLowerCase().trim()
|
|
110
|
+
: AUTH_STATUS.UNEXPECTED_ERROR
|
|
94
111
|
|
|
95
|
-
|
|
112
|
+
return {
|
|
96
113
|
success: false,
|
|
97
|
-
message:
|
|
98
|
-
? 'Invalid email or password'
|
|
99
|
-
: 'Unexpected error while setting password',
|
|
114
|
+
message: authMessage[authStatus] || 'Unexpected error occurred',
|
|
100
115
|
}
|
|
101
|
-
|
|
102
|
-
setState({ error: new Error('Failed to set password'), loading: false })
|
|
103
|
-
return errorResult
|
|
104
116
|
} finally {
|
|
105
|
-
|
|
117
|
+
setLoading(false)
|
|
106
118
|
}
|
|
107
119
|
}, [])
|
|
108
120
|
|
|
109
|
-
return {
|
|
110
|
-
setPassword,
|
|
111
|
-
error: state.error,
|
|
112
|
-
loading: state.loading,
|
|
113
|
-
}
|
|
121
|
+
return { setPassword, loading }
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
const startLogin = async ({
|
|
@@ -136,7 +144,10 @@ const startLogin = async ({
|
|
|
136
144
|
|
|
137
145
|
if (!response.ok) {
|
|
138
146
|
throw {
|
|
139
|
-
response: {
|
|
147
|
+
response: {
|
|
148
|
+
status: response.status,
|
|
149
|
+
statusText: response.statusText,
|
|
150
|
+
},
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
} catch (error) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7889],{6886:function(e,t,r){"use strict";r.d(t,{Z:function(){return MyAccountLayout_MyAccountLayout}});var s=r(6890),a=r(2210),n=r(727),i=r(9009),c=r(3339),o=r(7085),l=r.n(o),d=r(679),u=r(1549),Nav=e=>{var{items:t}=e,r=(0,c.useRouter)().pathname;return(0,u.jsx)("ul",{className:l().nav,children:t.map(e=>{var{route:t,title:s}=e;return(0,u.jsx)("li",{className:l().navItem,"data-is-selected":r.includes(t),children:(0,u.jsx)(n.Z,{href:t,tabIndex:0,children:s})},t)})})},MyAccountMenu_MyAccountMenu=e=>{var{avatarImageUrl:t,accountName:r,items:s}=e,{isDesktop:a}=(0,d.Z)();return(0,u.jsxs)("div",{className:l().menu,children:[a?(0,u.jsxs)("div",{className:l().account,children:[(0,u.jsxs)("div",{className:l().avatarContainer,children:[t?(0,u.jsx)("img",{className:l().avatar,src:t}):(0,u.jsx)("span",{className:l().avatar,children:null==r?void 0:r[0]}),(0,u.jsx)("h2",{children:r})]}),(0,u.jsx)(i.Z,{className:l().switchButton,variant:"secondary",size:"small",children:"Switch"})]}):null,(0,u.jsx)(Nav,{items:s})]})},p=[a.d3],MyAccountLayout_MyAccountLayout=e=>{var{children:t,accountName:r,isRepresentative:a=!0}=e,n=a?s.Z:s.Z.filter(e=>{var{route:t}=e;return!p.includes(t)});return(0,u.jsxs)("div",{className:l().layout,children:[(0,u.jsx)(MyAccountMenu_MyAccountMenu,{accountName:r,items:n}),(0,u.jsx)("section",{children:t})]})}},5893:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return M},default:function(){return Page}});var s,a=r(3067),n=r(5935),i=r(6886),c=r(9173),o=r(1772),l=r(6924),d=r(1549),after=function(){return(0,d.jsx)(d.Fragment,{})},before=function(){return(0,d.jsx)(d.Fragment,{})},u=r(6272),p=r(4194),y=r(9009),h=r(4988),w=r(3666),f=r(6652),j=r(2614),x=r(7215),b=r(5049),v=r(2256),m=r(7041),g=r(6899),_=r.n(g),S=r(4018),O=r(3412),P=r.n(O);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var useSetPassword=e=>{var t,{0:r,1:s}=(0,p.useState)({error:null,loading:!1});return{setPassword:(0,p.useCallback)((t=(0,h.Z)(function*(t){s(e=>_objectSpread(_objectSpread({},e),{},{loading:!0,error:null}));try{yield Z({email:t.userEmail,accountName:e});var r,a={login:t.userEmail,currentPassword:t.currentPassword,newPassword:t.newPassword,accesskey:t.accesskey?t.accesskey:null,recaptcha:t.recaptcha?t.recaptcha:null},n=yield _()("/api/vtexid/pub/authentication/classic/setpassword?expireSessions=true",{method:"POST",body:(0,S.GZ)(a),credentials:"include"});if(!n.ok)throw Error("Failed to set password: ".concat(n.status," ").concat(n.statusText));var i=null!==(r=yield n.json())&&void 0!==r?r:{authStatus:"Unexpected error",message:"Unexpected error while setting password"};if(!i){var c={success:!1,message:"No response from set password API"};return s({loading:!1,error:Error(c.message)}),c}return s({error:null,loading:!1}),{success:null!=i&&!!i.authStatus&&(null==i?void 0:i.authStatus.toLowerCase())==="success",message:"Password set successfully"}}catch(e){console.error("Error setting password:",e);var o="object"==typeof e&&null!==e&&"authStatus"in e?String(e.authStatus):"Unexpected error",l=o.toLowerCase().includes("invalidemail")||o.toLowerCase().includes("invalidpassword");return s({error:Error("Failed to set password"),loading:!1}),{success:!1,message:l?"Invalid email or password":"Unexpected error while setting password"}}finally{s(e=>_objectSpread(_objectSpread({},e),{},{loading:!1}))}}),function(e){return t.apply(this,arguments)}),[]),error:r.error,loading:r.loading}},Z=(s=(0,h.Z)(function*(e){var{email:t,accountName:r}=e;try{if(!(yield _()("/api/vtexid/pub/authentication/startlogin",{method:"POST",credentials:"include",body:(0,S.GZ)({user:t,scope:null!=r?r:P().api.storeId,accountName:null!=r?r:P().api.storeId,returnUrl:"/",callbackUrl:"/",fingerprint:null})})).ok)throw{response:{}}}catch(e){throw console.error("Error starting login:",e),e}}),function(e){return s.apply(this,arguments)}),C=r(7256),E=r.n(C),N=[{label:"8 characters",test:e=>e.length>=8},{label:"1 uppercase letter",test:e=>/[A-Z]/.test(e)},{label:"1 lowercase letter",test:e=>/[a-z]/.test(e)},{label:"1 number",test:e=>/\d/.test(e)}],SecurityDrawer=e=>{var t,{userEmail:r,accountName:s,isOpen:a,onClose:n}=e,{fade:i,fadeOut:c}=(0,w.b)(),{pushToast:o}=(0,f.l8)(),{0:l,1:u}=(0,p.useState)(""),{0:g,1:_}=(0,p.useState)(!1),{0:S,1:O}=(0,p.useState)(""),{0:P,1:Z}=(0,p.useState)(!1),{0:C,1:k}=(0,p.useState)(null),{setPassword:M,loading:A,error:R}=useSetPassword(s),D=N.map(e=>({label:e.label,isValid:e.test(S)})),I=D.every(e=>e.isValid),handleClose=()=>{k(null),u(""),_(!1),O(""),Z(!1),n()},F=(t=(0,h.Z)(function*(){if(!r){k("Email is required to set a new password.");return}if(!S||!l){k("All fields are required to set a new password.");return}if(S===l){k("New password cannot be the same as the current password.");return}try{var e=yield M({userEmail:r,currentPassword:l,newPassword:S});if(R)throw R;if(!e.success){o({title:"Error setting password",status:"ERROR",message:"Failed to set password: ".concat(e.message),icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyWarning"})});return}e.success&&(o({title:"Success setting password",status:"INFO",message:"Password updated successfully",icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyCheck"})}),handleClose())}catch(e){console.error("Error setting password:",e),o({title:"Error setting password",status:"ERROR",message:"Failed to set password.",icon:(0,d.jsx)(j.Z,{width:30,height:30,name:"CircleWavyWarning"})})}}),function(){return t.apply(this,arguments)});return(0,d.jsxs)(x.Z,{"data-fs-security-drawer":!0,fade:i,onDismiss:c,onTransitionEnd:()=>"out"===i&&handleClose(),isOpen:a,size:"partial",direction:"rightSide",overlayProps:{className:E().section},children:[(0,d.jsx)(b.Z,{"data-fs-security-drawer-header":!0,onClose:handleClose,children:(0,d.jsx)("h1",{"data-fs-security-drawer-header-title":!0,children:"Reset password"})}),(0,d.jsx)("div",{"data-fs-security-drawer-body":!0,children:(0,d.jsxs)("div",{"data-fs-security-drawer-body-form":!0,children:[(0,d.jsxs)("div",{"data-fs-security-drawer-body-current-password":!0,children:[(0,d.jsx)(v.Z,{"data-fs-security-drawer-input":!0,id:"security-drawer-input-current-password",type:g?"text":"password",placeholder:"Current Password",inputMode:"text",value:l,onChange:e=>{k(null),u(e.target.value)}}),(0,d.jsx)(m.Z,{"data-fs-security-drawer-input-password-toggle":!0,size:"small","aria-label":"Show Password",onClick:()=>_(e=>!e),icon:g?(0,d.jsx)(j.Z,{name:"EyeSlash"}):(0,d.jsx)(j.Z,{name:"Eye"})})]}),(0,d.jsxs)("div",{"data-fs-security-drawer-body-new-password":!0,children:[(0,d.jsx)(v.Z,{"data-fs-security-drawer-input":!0,id:"security-drawer-input-new-password",type:P?"text":"password",placeholder:"New Password",inputMode:"text",value:S,onChange:e=>{k(null),O(e.target.value)}}),(0,d.jsx)(m.Z,{"data-fs-security-drawer-input-password-toggle":!0,size:"small","aria-label":"Show Password",onClick:()=>Z(e=>!e),icon:P?(0,d.jsx)(j.Z,{name:"EyeSlash"}):(0,d.jsx)(j.Z,{name:"Eye"})})]}),C&&(0,d.jsxs)("div",{"data-fs-security-drawer-error":!0,children:[(0,d.jsx)(j.Z,{width:20,height:20,name:"CircleWavyWarning","data-fs-security-drawer-error-icon":!0}),(0,d.jsx)("span",{children:C})]}),S.length>0&&(0,d.jsxs)("div",{"data-fs-security-drawer-input-password-rules-container":!0,children:[(0,d.jsx)("p",{"data-fs-security-drawer-input-password-rules-title":!0,children:"Your password must have at least:"}),(0,d.jsx)("ul",{"data-fs-security-drawer-input-password-rules-list":!0,children:D.map((e,t)=>(0,d.jsxs)("li",{"data-fs-security-drawer-input-password-rule-item":!0,"data-status":e.isValid?"success":"error",children:[(0,d.jsx)(j.Z,{name:e.isValid?"CheckCircle":"XCircle",width:20,height:20}),e.label]},t))})]})]})}),(0,d.jsxs)("footer",{"data-fs-security-drawer-footer":!0,children:[(0,d.jsx)(y.Z,{variant:"tertiary",onClick:handleClose,children:"Cancel"}),(0,d.jsx)(y.Z,{"data-fs-security-drawer-footer-button":!0,variant:"primary",loading:A,disabled:A||!l||!S||!I,onClick:F,children:"Save Password"})]})]})},SecuritySection=e=>{var{userEmail:t,accountName:r}=e,{0:s,1:a}=(0,p.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsx)(SecurityDrawer,{userEmail:t,accountName:r,isOpen:s,onClose:()=>a(!1)}),(0,d.jsxs)("section",{"data-fs-securiry-section":!0,className:E().section,children:[(0,d.jsx)("header",{"data-fs-security-header":!0,children:(0,d.jsx)("h1",{"data-fs-security-title":!0,children:"Security"})}),(0,d.jsx)("div",{"data-fs-security-container":!0,children:(0,d.jsx)("table",{"data-fs-security-table":!0,children:(0,d.jsx)("tbody",{"data-fs-security-table-body":!0,children:(0,d.jsxs)("tr",{"data-fs-security-table-row":!0,children:[(0,d.jsx)("th",{"data-fs-security-table-heading":!0,children:"Password"}),(0,d.jsxs)("td",{"data-fs-security-table-data":!0,children:[(0,d.jsx)("span",{"data-fs-security-table-data-text":!0,children:"••••••••••"}),(0,d.jsx)(y.Z,{variant:"tertiary","data-fs-security-table-action-button":!0,onClick:()=>a(!0),children:"Reset password"})]})]})})})})]})]})};function security_ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function security_objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?security_ownKeys(Object(r),!0).forEach(function(t){(0,a.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):security_ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var k=security_objectSpread(security_objectSpread({},o.Z),l.Z),M=!0;function Page(e){var{globalSections:t,accountName:r,isRepresentative:s,userEmail:a}=e,{sections:o,settings:l}=null!=t?t:{};return(0,d.jsx)(u.ZP,{context:{globalSettings:l},children:(0,d.jsxs)(c.ZP,{globalSections:o,components:k,children:[(0,d.jsx)(n.PB,{noindex:!0,nofollow:!0}),(0,d.jsxs)(i.Z,{isRepresentative:s,accountName:r,children:[(0,d.jsx)(before,{}),(0,d.jsx)(SecuritySection,{userEmail:a}),(0,d.jsx)(after,{})]})]})})}},1855:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/security",function(){return r(5893)}])},7085:function(e){e.exports={layout:"section_layout__QJ4xs",menu:"section_menu__WKZdl",account:"section_account__YjCAC",avatarContainer:"section_avatarContainer__1RMsJ",switchButton:"section_switchButton__ul06M",nav:"section_nav__Jjee8",navItem:"section_navItem__yr27R",avatar:"section_avatar__IQLo8"}},7256:function(e){e.exports={section:"styles_section__tqV_v"}}},function(e){e.O(0,[6031,9173,9774,2888,179],function(){return e(e.s=1855)}),_N_E=e.O()}]);
|
|
File without changes
|