feat: use middleware to auth

This commit is contained in:
shinya
2025-06-30 20:58:55 +08:00
parent 3fe579bcba
commit f57cdb5ec1
5 changed files with 86 additions and 53 deletions

View File

@@ -27,11 +27,6 @@ function LoginPageClient() {
});
if (res.ok) {
// 保存密码以供后续请求使用
if (typeof window !== 'undefined') {
localStorage.setItem('password', password);
}
const redirect = searchParams.get('redirect') || '/';
router.replace(redirect);
} else if (res.status === 401) {