refactor state storge, UI editor

This commit is contained in:
taDuc
2026-05-07 13:38:52 +07:00
parent a29a3a2049
commit 8b1df73797
46 changed files with 3345 additions and 3112 deletions
+6 -2
View File
@@ -112,8 +112,12 @@ export default function SignInForm() {
<div className="grid grid-cols-1 gap-3 sm:gap-5">
<button
onClick={() => {
const redirectUrl = HOME_URL;
window.location.href = `${API.Auth.GOOGLE_LOGIN}?redirect=${redirectUrl}`;
// Redirect back to the same origin (avoid hard-coded port/env mismatches).
const redirectUrl =
typeof window !== "undefined" ? window.location.origin : HOME_URL;
window.location.href = `${API.Auth.GOOGLE_LOGIN}?redirect=${encodeURIComponent(
redirectUrl
)}`;
}}
className="inline-flex items-center justify-center gap-3 py-3 text-sm font-normal text-gray-700 transition-colors bg-gray-100 rounded-lg px-7 hover:bg-gray-200 hover:text-gray-800 dark:bg-white/5 dark:text-white/90 dark:hover:bg-white/10"
>
+8 -4
View File
@@ -163,11 +163,15 @@ export default function SignUpForm() {
<div className="grid grid-cols-1 gap-3 sm:gap-5">
<button
onClick={() => {
const redirectUrl = HOME_URL;
window.location.href = `${API.Auth.GOOGLE_LOGIN}?redirect=${redirectUrl}`;
// Redirect back to the same origin (avoid hard-coded port/env mismatches).
const redirectUrl =
typeof window !== "undefined" ? window.location.origin : HOME_URL;
window.location.href = `${API.Auth.GOOGLE_LOGIN}?redirect=${encodeURIComponent(
redirectUrl
)}`;
}}
className="inline-flex items-center justify-center gap-3 py-3 text-sm font-normal text-gray-700 transition-colors bg-gray-100 rounded-lg px-7 hover:bg-gray-200 hover:text-gray-800 dark:bg-white/5 dark:text-white/90 dark:hover:bg-white/10"
>
className="inline-flex items-center justify-center gap-3 py-3 text-sm font-normal text-gray-700 transition-colors bg-gray-100 rounded-lg px-7 hover:bg-gray-200 hover:text-gray-800 dark:bg-white/5 dark:text-white/90 dark:hover:bg-white/10"
>
<svg
width="20"
height="20"