Email SMTP Fix
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user