diff --git a/e2e/apps/react-native-oidc/app.config.ts b/e2e/apps/react-native-oidc/app.config.ts index 7856dac..897733a 100644 --- a/e2e/apps/react-native-oidc/app.config.ts +++ b/e2e/apps/react-native-oidc/app.config.ts @@ -17,5 +17,27 @@ export default ({ config }: ConfigContext) => ({ ...config, extra: { env - } + }, + "android": { + "package": "com.anonymous.reporeactnativeoidc" + }, + "ios": { + "bundleIdentifier": "com.anonymous.reporeactnativeoidc" + }, + scheme: "com.oktapreview.jperreault-test", + "plugins": [ + "expo-font", + "expo-router", + [ + "expo-build-properties", + { + "ios": { + "newArchEnabled": true + }, + "android": { + "newArchEnabled": true + } + } + ] + ] }); \ No newline at end of file diff --git a/e2e/apps/react-native-oidc/app/(login)/index.tsx b/e2e/apps/react-native-oidc/app/(login)/index.tsx index 13dcace..e3fd92d 100644 --- a/e2e/apps/react-native-oidc/app/(login)/index.tsx +++ b/e2e/apps/react-native-oidc/app/(login)/index.tsx @@ -1,5 +1,5 @@ -import { useEffect } from 'react'; -import { StyleSheet } from 'react-native'; +import { useCallback, useEffect, useState } from 'react'; +import { StyleSheet, Button } from 'react-native'; import { Image } from 'expo-image'; import Constants from 'expo-constants'; import { useAuth } from '@/hooks/useAuth'; @@ -12,12 +12,42 @@ import { HelloWave } from '@/components/HelloWave'; export default function LoginScreen () { const { signIn } = useAuth(); + const [ authError, setAuthError ] = useState(null); + + const signInFunc = useCallback(async () => { + try { + await signIn('/(login)/token'); + } + catch (err) { + setAuthError(err as Error); + } + }, [signIn, setAuthError]); useEffect(() => { (async () => { - await signIn('/(login)/token'); + await signInFunc(); })(); - }, [signIn]); + }, [signInFunc]); + + let view = ( + <> + Loading... + + + ); + + if (authError) { + view = ( + <> + Error + {authError.message} +