Skip to content

Commit e705a23

Browse files
authoredMar 14, 2025··
Bind the password form (#15748)
* Bind the password form * Type fixes
1 parent 59fe147 commit e705a23

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎packages/builder/src/pages/builder/auth/reset.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<Heading size="M">Reset your password</Heading>
8080
<Body size="M">Must contain at least 12 characters</Body>
8181
<PasswordRepeatInput
82+
bind:passwordForm={form}
8283
bind:password
8384
bind:error={passwordError}
8485
minLength={$admin.passwordMinLength || 12}

‎packages/frontend-core/src/components/PasswordRepeatInput.svelte

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
<script>
1+
<script lang="ts">
22
import { FancyForm, FancyInput } from "@budibase/bbui"
33
import { createValidationStore, requiredValidator } from "../utils/validation"
44
5-
export let password
6-
export let error
5+
export let passwordForm: FancyForm | undefined = undefined
6+
export let password: string
7+
export let error: string
78
export let minLength = "12"
89
9-
const validatePassword = value => {
10-
if (!value || value.length < minLength) {
10+
const validatePassword = (value: string | undefined) => {
11+
if (!value || value.length < parseInt(minLength)) {
1112
return `Please enter at least ${minLength} characters. We recommend using machine generated or random passwords.`
1213
}
1314
return null
@@ -35,7 +36,7 @@
3536
firstPasswordError
3637
</script>
3738

38-
<FancyForm>
39+
<FancyForm bind:this={passwordForm}>
3940
<FancyInput
4041
label="Password"
4142
type="password"

0 commit comments

Comments
 (0)
Please sign in to comment.