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