Skip to content

Commit

Permalink
fix(web): logout and clear user store when using back button on the c…
Browse files Browse the repository at this point in the history
…hange password form (immich-app#6288)
  • Loading branch information
alextran1502 authored Jan 9, 2024
1 parent 8d0a619 commit 8d1287e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/src/routes/auth/login/+page.svelte
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 8d1287e

Please sign in to comment.