mirror of
https://github.com/immich-app/immich.git
synced 2025-01-17 01:06:46 +01:00
fix(web): logout and clear user store when using back button on the change password form (#6288)
This commit is contained in:
parent
8d0a619e81
commit
8d1287ef15
1 changed files with 10 additions and 1 deletions
|
@ -1,12 +1,21 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { afterNavigate, goto } from '$app/navigation';
|
||||||
import LoginForm from '$lib/components/forms/login-form.svelte';
|
import LoginForm from '$lib/components/forms/login-form.svelte';
|
||||||
import FullscreenContainer from '$lib/components/shared-components/fullscreen-container.svelte';
|
import FullscreenContainer from '$lib/components/shared-components/fullscreen-container.svelte';
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import { featureFlags, serverConfig } from '$lib/stores/server-config.store';
|
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';
|
import type { PageData } from './$types';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|
afterNavigate(async ({ from }) => {
|
||||||
|
if (from?.url.pathname === AppRoute.AUTH_CHANGE_PASSWORD) {
|
||||||
|
resetSavedUser();
|
||||||
|
await api.authenticationApi.logout();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $featureFlags.loaded}
|
{#if $featureFlags.loaded}
|
||||||
|
|
Loading…
Reference in a new issue