1
0
Fork 0
mirror of synced 2024-07-09 08:16:34 +12:00
budibase/packages/builder/src/components/settings/ChangePasswordModal.svelte

28 lines
740 B
Svelte

<script>
import { ModalContent, Body, notifications } from "@budibase/bbui"
import PasswordRepeatInput from "components/common/users/PasswordRepeatInput.svelte"
import { auth } from "stores/portal"
let password
let error
const updatePassword = async () => {
try {
await auth.updateSelf({ password })
notifications.success("Password changed successfully")
} catch (error) {
notifications.error("Failed to update password")
}
}
</script>
<ModalContent
title="Update password"
confirmText="Update password"
onConfirm={updatePassword}
disabled={error || !password}
>
<Body size="S">Enter your new password below.</Body>
<PasswordRepeatInput bind:password bind:error />
</ModalContent>