feat: integrate oauth store in authorize page
This commit is contained in:
@ -5,20 +5,20 @@ import { ArrowLeftRight, ChevronDown } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Avatar from "@/feature/Avatar";
|
||||
import { useAuth } from "@/store/auth";
|
||||
import { useOAuthContext } from "@/context/oauth";
|
||||
import { useOAuth } from "@/store/oauth";
|
||||
|
||||
const AuthorizePage: FC = () => {
|
||||
const promptAccountSelection = useAuth((state) => state.deleteActiveAccount);
|
||||
const activeAccount = useAuth((state) => state.activeAccount);
|
||||
|
||||
const oauth = useOAuthContext();
|
||||
|
||||
const profile = useAuth((state) => state.profile);
|
||||
|
||||
const selectSession = useOAuth((state) => state.selectSession);
|
||||
|
||||
const handleAgree = useCallback(() => {
|
||||
if (!activeAccount) return;
|
||||
oauth.selectSession(activeAccount.access);
|
||||
}, [activeAccount, oauth]);
|
||||
selectSession(activeAccount.access);
|
||||
}, [activeAccount, selectSession]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
Reference in New Issue
Block a user