+2
-1
@@ -13,7 +13,7 @@ const API_BASE_URL =
|
||||
function LoginPageContent() {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const { login, loading } = useAuth();
|
||||
const { login, refreshUser, loading } = useAuth();
|
||||
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
@@ -36,6 +36,7 @@ function LoginPageContent() {
|
||||
|
||||
try {
|
||||
await login({ email, password });
|
||||
await refreshUser();
|
||||
router.push(next);
|
||||
} catch (err: any) {
|
||||
setError(err?.message ?? "Failed to log in");
|
||||
|
||||
Reference in New Issue
Block a user