Email SMTP Fix

This commit is contained in:
Koncept Kit
2025-12-07 16:59:21 +07:00
parent 7b8ee6442a
commit 79cebd205c
15 changed files with 978 additions and 78 deletions

View File

@@ -3,6 +3,7 @@ import { useNavigate, Link } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { Button } from '../components/ui/button';
import { Input } from '../components/ui/input';
import { PasswordInput } from '../components/ui/password-input';
import { Label } from '../components/ui/label';
import { Card } from '../components/ui/card';
import { toast } from 'sonner';
@@ -30,7 +31,16 @@ const Login = () => {
try {
const user = await login(formData.email, formData.password);
toast.success('Login successful!');
// Check if password change is required
if (user.force_password_change) {
toast.warning('You must change your password before continuing', {
duration: 5000
});
navigate('/change-password-required');
return;
}
if (user.role === 'admin') {
navigate('/admin');
} else {
@@ -82,11 +92,15 @@ const Login = () => {
</div>
<div>
<Label htmlFor="password">Password</Label>
<Input
<div className="flex items-center justify-between mb-2">
<Label htmlFor="password">Password</Label>
<Link to="/forgot-password" className="text-sm text-[#E07A5F] hover:underline">
Forgot password?
</Link>
</div>
<PasswordInput
id="password"
name="password"
type="password"
required
value={formData.password}
onChange={handleInputChange}