fix: don't select account after logging into it

This commit is contained in:
2025-05-29 14:57:35 +02:00
parent dd5c59afa8
commit 4b3a814d7e

View File

@ -9,7 +9,6 @@ import { useForm, type SubmitHandler } from "react-hook-form";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { loginApi } from "@/api/login"; import { loginApi } from "@/api/login";
import { useAccountRepo } from "@/repository/account"; import { useAccountRepo } from "@/repository/account";
import { useOAuthContext } from "@/context/oauth";
import { useAuth } from "@/store/auth"; import { useAuth } from "@/store/auth";
interface LoginForm { interface LoginForm {
@ -29,8 +28,6 @@ export default function LoginPage() {
const [error, setError] = useState(""); const [error, setError] = useState("");
const [success, setSuccess] = useState(""); const [success, setSuccess] = useState("");
const oauth = useOAuthContext();
const repo = useAccountRepo(); const repo = useAccountRepo();
const location = useLocation(); const location = useLocation();
@ -65,7 +62,6 @@ export default function LoginPage() {
setSuccess("You have successfully logged in"); setSuccess("You have successfully logged in");
reset(); reset();
oauth.selectSession(response.access);
await updateActiveAccount(account); await updateActiveAccount(account);
} catch (err: any) { } catch (err: any) {
console.log(err); console.log(err);
@ -77,7 +73,7 @@ export default function LoginPage() {
setLoading(false); setLoading(false);
} }
}, },
[repo, reset, oauth, updateActiveAccount] [repo, reset, updateActiveAccount]
); );
return ( return (