2022-08-24 21:10:48 -07:00
|
|
|
<script lang="ts">
|
2023-07-01 00:50:47 -04:00
|
|
|
import { goto } from '$app/navigation';
|
|
|
|
|
import ChangePasswordForm from '$lib/components/forms/change-password-form.svelte';
|
|
|
|
|
import FullscreenContainer from '$lib/components/shared-components/fullscreen-container.svelte';
|
|
|
|
|
import { AppRoute } from '$lib/constants';
|
|
|
|
|
import type { PageData } from './$types';
|
2022-08-24 21:10:48 -07:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
export let data: PageData;
|
2022-08-24 21:10:48 -07:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
const onSuccessHandler = async () => {
|
|
|
|
|
await fetch(AppRoute.AUTH_LOGOUT, { method: 'POST' });
|
2022-08-24 21:10:48 -07:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
goto(AppRoute.AUTH_LOGIN);
|
|
|
|
|
};
|
2022-08-24 21:10:48 -07:00
|
|
|
</script>
|
|
|
|
|
|
2023-03-15 22:38:29 +01:00
|
|
|
<FullscreenContainer title={data.meta.title}>
|
2023-07-01 00:50:47 -04:00
|
|
|
<p slot="message">
|
2023-11-11 20:03:32 -05:00
|
|
|
Hi {data.user.name} ({data.user.email}),
|
2023-07-01 00:50:47 -04:00
|
|
|
<br />
|
|
|
|
|
<br />
|
|
|
|
|
This is either the first time you are signing into the system or a request has been made to change your password. Please
|
|
|
|
|
enter the new password below.
|
|
|
|
|
</p>
|
2023-03-15 22:38:29 +01:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
<ChangePasswordForm user={data.user} on:success={onSuccessHandler} />
|
2023-03-15 22:38:29 +01:00
|
|
|
</FullscreenContainer>
|