1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix(web): logout and clear user store when using back button on the change password form (#6288)

This commit is contained in:
Alex 2024-01-09 09:32:23 -06:00 committed by GitHub
parent 8d0a619e81
commit 8d1287ef15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,21 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { afterNavigate, goto } from '$app/navigation';
import LoginForm from '$lib/components/forms/login-form.svelte';
import FullscreenContainer from '$lib/components/shared-components/fullscreen-container.svelte';
import { AppRoute } from '$lib/constants';
import { featureFlags, serverConfig } from '$lib/stores/server-config.store';
import { resetSavedUser } from '$lib/stores/user.store';
import { api } from '@api';
import type { PageData } from './$types';
export let data: PageData;
afterNavigate(async ({ from }) => {
if (from?.url.pathname === AppRoute.AUTH_CHANGE_PASSWORD) {
resetSavedUser();
await api.authenticationApi.logout();
}
});
</script>
{#if $featureFlags.loaded}