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:
parent
8d0a619e81
commit
8d1287ef15
1 changed files with 10 additions and 1 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue