Bind the password form (#15748)

* Bind the password form

* Type fixes
This commit is contained in:
melohagan 2025-03-14 14:24:07 +00:00 committed by GitHub
parent 59fe147863
commit e705a23b74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -79,6 +79,7 @@
<Heading size="M">Reset your password</Heading>
<Body size="M">Must contain at least 12 characters</Body>
<PasswordRepeatInput
bind:passwordForm={form}
bind:password
bind:error={passwordError}
minLength={$admin.passwordMinLength || 12}

View File

@ -1,13 +1,14 @@
<script>
<script lang="ts">
import { FancyForm, FancyInput } from "@budibase/bbui"
import { createValidationStore, requiredValidator } from "../utils/validation"
export let password
export let error
export let passwordForm: FancyForm | undefined = undefined
export let password: string
export let error: string
export let minLength = "12"
const validatePassword = value => {
if (!value || value.length < minLength) {
const validatePassword = (value: string | undefined) => {
if (!value || value.length < parseInt(minLength)) {
return `Please enter at least ${minLength} characters. We recommend using machine generated or random passwords.`
}
return null
@ -35,7 +36,7 @@
firstPasswordError
</script>
<FancyForm>
<FancyForm bind:this={passwordForm}>
<FancyInput
label="Password"
type="password"