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';
|
2024-02-27 08:37:37 -08:00
|
|
|
import { resetSavedUser, user } from '$lib/stores/user.store';
|
|
|
|
|
import { logout } from '@immich/sdk';
|
2023-07-01 00:50:47 -04:00
|
|
|
import type { PageData } from './$types';
|
2024-06-24 15:50:01 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2022-08-24 21:10:48 -07:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
export let data: PageData;
|
2024-02-27 08:37:37 -08:00
|
|
|
|
|
|
|
|
const onSuccess = async () => {
|
|
|
|
|
await goto(AppRoute.AUTH_LOGIN);
|
|
|
|
|
resetSavedUser();
|
|
|
|
|
await logout();
|
|
|
|
|
};
|
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">
|
2024-06-24 15:50:01 +02:00
|
|
|
{$t('hi_user', { values: { name: $user.name, email: $user.email } })}
|
2023-07-01 00:50:47 -04:00
|
|
|
<br />
|
|
|
|
|
<br />
|
2024-06-24 15:50:01 +02:00
|
|
|
{$t('change_password_description')}
|
2023-07-01 00:50:47 -04:00
|
|
|
</p>
|
2023-03-15 22:38:29 +01:00
|
|
|
|
2024-09-20 23:02:58 +02:00
|
|
|
<ChangePasswordForm {onSuccess} />
|
2023-03-15 22:38:29 +01:00
|
|
|
</FullscreenContainer>
|