mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-13 15:35:00 +02:00
allow comma in password closes #121
This commit is contained in:
parent
57cd776c34
commit
bb5573a8f4
2 changed files with 4 additions and 6 deletions
|
@ -4,7 +4,7 @@ export const passwordSchema = z
|
||||||
.string()
|
.string()
|
||||||
.min(8, { message: "Password must be at least 8 characters long" })
|
.min(8, { message: "Password must be at least 8 characters long" })
|
||||||
.max(64, { message: "Password must be at most 64 characters long" })
|
.max(64, { message: "Password must be at most 64 characters long" })
|
||||||
.regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).*$/, {
|
.regex(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[,#?!@$%^&*-]).*$/, {
|
||||||
message: `Your password must meet the following conditions:
|
message: `Your password must meet the following conditions:
|
||||||
at least one uppercase English letter,
|
at least one uppercase English letter,
|
||||||
at least one lowercase English letter,
|
at least one lowercase English letter,
|
||||||
|
|
|
@ -164,8 +164,6 @@ export default function CreateResourceForm({
|
||||||
}, [open]);
|
}, [open]);
|
||||||
|
|
||||||
async function onSubmit(data: CreateResourceFormValues) {
|
async function onSubmit(data: CreateResourceFormValues) {
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
const res = await api
|
const res = await api
|
||||||
.put<AxiosResponse<Resource>>(
|
.put<AxiosResponse<Resource>>(
|
||||||
`/org/${orgId}/site/${data.siteId}/resource/`,
|
`/org/${orgId}/site/${data.siteId}/resource/`,
|
||||||
|
@ -194,16 +192,16 @@ export default function CreateResourceForm({
|
||||||
setResourceId(id);
|
setResourceId(id);
|
||||||
|
|
||||||
if (data.http) {
|
if (data.http) {
|
||||||
goToResource();
|
goToResource(id);
|
||||||
} else {
|
} else {
|
||||||
setShowSnippets(true);
|
setShowSnippets(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function goToResource() {
|
function goToResource(id?: number) {
|
||||||
// navigate to the resource page
|
// navigate to the resource page
|
||||||
router.push(`/${orgId}/settings/resources/${resourceId}`);
|
router.push(`/${orgId}/settings/resources/${id || resourceId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue