From 67529c565cd33b11e04a6be8aebc60492529f023 Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Wed, 10 Dec 2025 15:52:01 +0500 Subject: [PATCH] Pass state param to github callback --- frontend/src/App/Login/LoginByGithubCallback/index.tsx | 5 +++-- frontend/src/services/auth.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/App/Login/LoginByGithubCallback/index.tsx b/frontend/src/App/Login/LoginByGithubCallback/index.tsx index 814846631d..27d5a755a7 100644 --- a/frontend/src/App/Login/LoginByGithubCallback/index.tsx +++ b/frontend/src/App/Login/LoginByGithubCallback/index.tsx @@ -19,6 +19,7 @@ export const LoginByGithubCallback: React.FC = () => { const [searchParams] = useSearchParams(); const navigate = useNavigate(); const code = searchParams.get('code'); + const state = searchParams.get('state'); const [isInvalidCode, setIsInvalidCode] = useState(false); const dispatch = useAppDispatch(); @@ -26,8 +27,8 @@ export const LoginByGithubCallback: React.FC = () => { const [getProjects] = useLazyGetProjectsQuery(); const checkCode = () => { - if (code) { - githubCallback({ code }) + if (code && state) { + githubCallback({ code, state }) .unwrap() .then(async ({ creds: { token } }) => { dispatch(setAuthData({ token })); diff --git a/frontend/src/services/auth.ts b/frontend/src/services/auth.ts index 5b1f99d406..f65892911a 100644 --- a/frontend/src/services/auth.ts +++ b/frontend/src/services/auth.ts @@ -19,7 +19,7 @@ export const authApi = createApi({ }), }), - githubCallback: builder.mutation({ + githubCallback: builder.mutation({ query: (body) => ({ url: API.AUTH.GITHUB.CALLBACK(), method: 'POST',