diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index e9f08e0..4f9fda3 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -313,6 +313,13 @@ const STYLES = ` display:flex;align-items:center;gap:0.5rem; } + .lg-success { + background:#f0fdf4;border:2px solid #bbf7d0;border-radius:14px;padding:0.8rem 1rem; + font-family:'Nunito Sans',sans-serif;font-size:0.82rem;font-weight:700;color:#15803d; + display:flex;align-items:center;gap:0.5rem; + animation: formPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both; + } + .lg-btn { width:100%;padding:1rem;background:#f97316;color:white;border:none;border-radius:100px;cursor:pointer; font-family:'Nunito',sans-serif;font-size:1rem;font-weight:900; @@ -365,8 +372,14 @@ export const Login = () => { const navigate = useNavigate(); const location = useLocation(); - const { login, isAuthenticated, isLoading, error, clearError } = - useAuthStore(); + const { + login, + isAuthenticated, + isLoading, + error, + clearError, + registrationMessage, + } = useAuthStore(); const from = (location.state as LocationState)?.from?.pathname || "/student/home"; @@ -673,6 +686,12 @@ export const Login = () => { + {registrationMessage && ( +
+ {registrationMessage} +
+ )} + {error && (
⚠️ {error} diff --git a/src/pages/auth/Register.tsx b/src/pages/auth/Register.tsx index 9685d65..bf7ca73 100644 --- a/src/pages/auth/Register.tsx +++ b/src/pages/auth/Register.tsx @@ -758,7 +758,7 @@ export const Register = () => { avatar_url: avatarUrl, password, }); - if (success) navigate("/student/home", { replace: true }); + if (success) navigate("/login", { replace: true }); }; return (