Compare commits
2 Commits
35cc0f9a47
...
5397a601c6
| Author | SHA1 | Date | |
|---|---|---|---|
| 5397a601c6 | |||
| 4c83fcf7b4 |
@ -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 = () => {
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{registrationMessage && (
|
||||
<div className="lg-success">
|
||||
<span>✅</span> {registrationMessage}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && (
|
||||
<div className="lg-error">
|
||||
<span>⚠️</span> {error}
|
||||
|
||||
@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user