Merge pull request 'feat(auth): add registration message for successful registration' (#4) from web into main

Reviewed-on: #4
This commit is contained in:
2026-03-12 07:53:00 +00:00
2 changed files with 22 additions and 3 deletions

View File

@ -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}

View File

@ -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 (