Skip to content

Commit 9cb8ff5

Browse files
committed
fix: Update Google client IDs for Expo Go and add debug logging for auth requests
1 parent f52faac commit 9cb8ff5

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

frontend/context/AuthContext.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,26 @@ export const AuthProvider = ({ children }) => {
1919
const [refresh, setRefresh] = useState(null);
2020
const [isLoading, setIsLoading] = useState(true);
2121

22+
// For Expo Go, we need to use the web-based auth flow
23+
// Force all platforms to use web client ID in Expo Go
2224
const [request, response, promptAsync] = useAuthRequest({
23-
expoClientId: process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID, // Use web client ID for Expo Go
24-
iosClientId: process.env.EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID,
25-
androidClientId: process.env.EXPO_PUBLIC_GOOGLE_ANDROID_CLIENT_ID,
25+
expoClientId: process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID,
26+
iosClientId: process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID, // Force web client for iOS in Expo Go
27+
androidClientId: process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID, // Force web client for Android in Expo Go
2628
webClientId: process.env.EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID,
29+
redirectUri: 'https://auth.expo.io/@devasy23/frontend',
2730
});
2831

32+
// Debug logging
33+
useEffect(() => {
34+
if (request) {
35+
console.log("Auth request details:", {
36+
url: request.url,
37+
params: request.params
38+
});
39+
}
40+
}, [request]);
41+
2942
useEffect(() => {
3043
const handleGoogleSignIn = async () => {
3144
if (response?.type === "success") {

0 commit comments

Comments
 (0)