Skip to content

Commit 63563aa

Browse files
gvelez17claude
andcommitted
Fix GitHub OAuth to send correct payload to backend
- Send { code, client_id } instead of { githubAuthCode } - Fix MobileLogin to use VITE_GITHUB_CLIENT_ID instead of REACT_APP_* - This enables multiple GitHub OAuth apps for different frontends 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5c7ac76 commit 63563aa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/containers/Login/MobileLogin.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import circles from '../../assets/images/Circles.svg'
1919
import Ellipse from '../../assets/images/Ellipse.svg'
2020
import { GoogleLogin } from '@react-oauth/google'
2121
import { handleAuthSuccess } from '../../utils/authUtils'
22+
import { GITHUB_CLIENT_ID } from '../../utils/settings'
2223

23-
const githubUrl = `https://github.com/login/oauth/authorize?client_id=${process.env.REACT_APP_GITHUB_CLIENT_ID}`
24+
const githubUrl = `https://github.com/login/oauth/authorize?client_id=${GITHUB_CLIENT_ID}`
2425

2526
const MobileLogin = ({ toggleSnackbar, setSnackbarMessage, setLoading, toggleTheme, isDarkMode }: ILoginProps) => {
2627
const theme = useTheme()

src/containers/Login/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const Login = ({ toggleSnackbar, setSnackbarMessage, setLoading, toggleTheme, is
6363
if (githubAuthCode) {
6464
const githubAuthUrl = '/auth/github'
6565
axios
66-
.post(githubAuthUrl, { githubAuthCode })
66+
.post(githubAuthUrl, { code: githubAuthCode, client_id: GITHUB_CLIENT_ID })
6767
.then(res => {
6868
const { accessToken, refreshToken } = res.data
6969
handleAuth(accessToken, refreshToken)

0 commit comments

Comments
 (0)