Working expo-auth-session with Google, can't understand the redirectUri

Expo 41. Platforms iOS, Android, Expo Go
Type: Managed app

Hi,

I successfully got working the Google authentication using expo-auth-session, however everytime I log in, it redirects my app on an invalid route.

I used the expo cli to create the project and my LinkingConfiguration looks like this

import * as Linking from 'expo-linking';

export default {
  prefixes: [Linking.makeUrl('/')],
  config: {
    screens: {
      Root: '/',
      Cards: '/cards',
      RecoverPassword: '/recover-password',
      NotFound: '*',
    },
  },
};

The NotFound route is opened everytime I login. Is there a way to open the /cards route instead on success and / (Root) on failure?

My guess was that it was the purpose of the ‘redirectUri’, but I haven’t been able to get it to work.

Thank you
James

Related code in case:

  const [_request, _response, promptAsync] = Google.useAuthRequest({
    expoClientId: Environment.google.expoClientId,
    iosClientId: Environment.google.iOSClientId,
    androidClientId: Environment.google.androidClientId,
  });


  const googleLogin = async () => {
    try {
      const result: AuthSessionResult = await promptAsync();

      if (result.type === 'success' && result.authentication) {
        const user =  await socialLogin({
          provider: SocialLoginType.Google,
          access_token: result.authentication.accessToken
        });
        
        setUser({ ...user });
      }
    } catch (error) {
      alert(`Google Login Error: ${error}`);
    }
  };

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.