浏览代码

Fix redirect to login page after password change (#461)

* Fix redirect to login page after password change

Copied from the similar fix in #414

* Fix typo in change-password form

* Remove misplaced text from user management page
bo0tzz 3 年之前
父节点
当前提交
2bf6cd9241

+ 0 - 2
web/src/lib/components/admin-page/user-management.svelte

@@ -8,8 +8,6 @@
 	const dispatch = createEventDispatcher();
 	const dispatch = createEventDispatcher();
 </script>
 </script>
 
 
-<p class="text-sm">USER LIST</p>
-
 <table class="text-left w-full my-4">
 <table class="text-left w-full my-4">
 	<thead class="border rounded-md mb-2 bg-gray-50 flex text-immich-primary w-full h-12 ">
 	<thead class="border rounded-md mb-2 bg-gray-50 flex text-immich-primary w-full h-12 ">
 		<tr class="flex w-full place-items-center">
 		<tr class="flex w-full place-items-center">

+ 1 - 1
web/src/lib/components/forms/change-password-form.svelte

@@ -47,7 +47,7 @@
 <div class="border bg-white p-4 shadow-sm w-[500px] rounded-md py-8">
 <div class="border bg-white p-4 shadow-sm w-[500px] rounded-md py-8">
 	<div class="flex flex-col place-items-center place-content-center gap-4 px-4">
 	<div class="flex flex-col place-items-center place-content-center gap-4 px-4">
 		<img class="text-center" src="/immich-logo.svg" height="100" width="100" alt="immich-logo" />
 		<img class="text-center" src="/immich-logo.svg" height="100" width="100" alt="immich-logo" />
-		<h1 class="text-2xl text-immich-primary font-medium">Chage Password</h1>
+		<h1 class="text-2xl text-immich-primary font-medium">Change Password</h1>
 
 
 		<p class="text-sm border rounded-md p-4 font-mono text-gray-600">
 		<p class="text-sm border rounded-md p-4 font-mono text-gray-600">
 			Hi {user.firstName}
 			Hi {user.firstName}

+ 3 - 6
web/src/routes/auth/change-password/index.svelte

@@ -39,12 +39,9 @@
 	export let user: UserResponseDto;
 	export let user: UserResponseDto;
 
 
 	const onSuccessHandler = async () => {
 	const onSuccessHandler = async () => {
-		/** Svelte route fetch */
-		const res = await fetch('/auth/logout', { method: 'POST' });
-
-		if (res.status == 200 && res.statusText == 'OK') {
-			goto('/auth/login');
-		}
+		await fetch('auth/logout', { method: 'POST' });
+		
+		goto('/auth/login');
 	};
 	};
 </script>
 </script>