Skip to content

Commit edaeb1e

Browse files
fix: ensure pw confirmation when creating users in admin panel (#7535)
1 parent 6f35c35 commit edaeb1e

File tree

1 file changed

+9
-1
lines changed
  • packages/next/src/views/Edit/Default

1 file changed

+9
-1
lines changed

packages/next/src/views/Edit/Default/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ export const DefaultEditView: React.FC = () => {
103103
const classes = [baseClass, id && `${baseClass}--is-editing`].filter(Boolean).join(' ')
104104

105105
const [schemaPath, setSchemaPath] = React.useState(entitySlug)
106-
const [validateBeforeSubmit, setValidateBeforeSubmit] = useState(false)
106+
const [validateBeforeSubmit, setValidateBeforeSubmit] = useState(() => {
107+
if (
108+
operation === 'create' &&
109+
collectionConfig.auth &&
110+
!collectionConfig.auth.disableLocalStrategy
111+
)
112+
return true
113+
return false
114+
})
107115

108116
const onSave = useCallback(
109117
(json) => {

0 commit comments

Comments
 (0)