© 2026 Hedgehog Software, LLC
https://accounts.google.com/o/oauth2/auth?response_type=code
export const useGoogleSignIn = () => { const { data: isAuthenticated } = authClient.useSession(); const navContainerRef = useNavigationContainerRef(); useEffect(() => { if (isAuthenticated) { if (navContainerRef.isReady()) { router.push('/recent-businesses'); } } // eslint-disable-next-line react-hooks/exhaustive-deps }, [isAuthenticated, navContainerRef.isReady()]); return useCallback(async () => { console.log('callback called'); try { const { error, data } = await authClient.signIn.social({ provider: 'google', callbackURL: '/', }); if (error) { console.error(error); } console.log(data); } catch (err) { console.error(err); } }, []); };
const googleSignIn = useGoogleSignIn();
<Pressable style={[styles.altLoginButton]} onPress={async () => { console.log('pressed'); googleSignIn(); }} > <Image source={ Platform.OS !== 'web' ? 'google' : require('@/assets/images/google.png') } style={styles.googleIcon} /> <Text style={[styles.altLoginText, Fonts.interRegular]}> Google </Text> </Pressable>
"better-auth": "1.2.6-beta.6",
disableDefaultFetchPlugins