mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-03 11:22:29 +00:00
chore: password reset ts typing
This commit is contained in:
parent
06ce2499b0
commit
4dfa972bd5
@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import { handleUnauthenticatedPasswordResetConfirm } from '$util/database'
|
|
||||||
import AlertBar from '$components/AlertBar.svelte'
|
import AlertBar from '$components/AlertBar.svelte'
|
||||||
|
import { handleUnauthenticatedPasswordResetConfirm } from '$util/database'
|
||||||
|
|
||||||
let password: string = ''
|
let password: string = ''
|
||||||
let token: string = ''
|
let token: string | null = ''
|
||||||
let formError: string = ''
|
let formError: string = ''
|
||||||
|
|
||||||
// Check for a token in the URL
|
// Check for a token in the URL
|
||||||
@ -13,10 +13,11 @@
|
|||||||
let isFormButtonDisabled: boolean = true
|
let isFormButtonDisabled: boolean = true
|
||||||
$: isFormButtonDisabled = password.length === 0
|
$: isFormButtonDisabled = password.length === 0
|
||||||
|
|
||||||
const handleSubmit = async (e: SubmitEvent) => {
|
const handleSubmit = async (e: Event) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
isFormButtonDisabled = true
|
isFormButtonDisabled = true
|
||||||
|
if (!token) return
|
||||||
|
|
||||||
await handleUnauthenticatedPasswordResetConfirm(token, password, (error) => {
|
await handleUnauthenticatedPasswordResetConfirm(token, password, (error) => {
|
||||||
formError = error
|
formError = error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user