diff --git a/web/src/pages/Authorize/index.tsx b/web/src/pages/Authorize/index.tsx index c0b80f6..95f6b7b 100644 --- a/web/src/pages/Authorize/index.tsx +++ b/web/src/pages/Authorize/index.tsx @@ -1,13 +1,24 @@ -import { type FC } from "react"; +import { useCallback, type FC } from "react"; import { Card, CardContent } from "@/components/ui/card"; 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"; 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 handleAgree = useCallback(() => { + if (!activeAccount) return; + oauth.selectSession(activeAccount.access); + }, [activeAccount, oauth]); return (
- qwer.009771@gmail.com + {profile?.email}