stefandjokic
stefandjokic3mo ago

I see "`auth:store` type: signIn" on Convex, but nothing happens on the frontend (React Native)

Hi everyone! I'm running a self-hosted Convex instance, which seems to have partially working authentication. For instance, when I sign up as a new user (I'm only using the basic email+password strategy), and I try to sign up again with the same email, I get an error saying that the email already exists. However, after the successful sign up AND after trying to sign in, it seems that everything was fine on the BE / Convex side, but nothing happens on the mobile app. What could be wrong? _layout.tsx:
const convex = new ConvexReactClient(process.env.EXPO_PUBLIC_CONVEX_URL!, {
unsavedChangesWarning: false,
})

const secureStorage = {
getItem: SecureStore.getItemAsync,
setItem: SecureStore.setItemAsync,
removeItem: SecureStore.deleteItemAsync,
}

export default function RootLayout() {
return (
<ConvexAuthProvider
client={convex}
storage={
Platform.OS === "android" || Platform.OS === "ios"
? secureStorage
: undefined
}
>
<Stack>
<Stack.Screen name="index" />
</Stack>
</ConvexAuthProvider>
)
}
const convex = new ConvexReactClient(process.env.EXPO_PUBLIC_CONVEX_URL!, {
unsavedChangesWarning: false,
})

const secureStorage = {
getItem: SecureStore.getItemAsync,
setItem: SecureStore.setItemAsync,
removeItem: SecureStore.deleteItemAsync,
}

export default function RootLayout() {
return (
<ConvexAuthProvider
client={convex}
storage={
Platform.OS === "android" || Platform.OS === "ios"
? secureStorage
: undefined
}
>
<Stack>
<Stack.Screen name="index" />
</Stack>
</ConvexAuthProvider>
)
}
index.tsx:
export default function Index() {
const submissions = useQuery(...)

return (
<SafeAreaView style={homeStyles.container}>
<ScrollView contentContainerStyle={homeStyles.scrollContainer}>
<Authenticated>
*** UNREACHABLE CODE ***
</View>
</Authenticated>
<Unauthenticated>
*** THIS COMPONENT ALWAYS STAYS ON THE SCREEN ***
<SignIn />
</Unauthenticated>
</ScrollView>
</SafeAreaView>
)
}
export default function Index() {
const submissions = useQuery(...)

return (
<SafeAreaView style={homeStyles.container}>
<ScrollView contentContainerStyle={homeStyles.scrollContainer}>
<Authenticated>
*** UNREACHABLE CODE ***
</View>
</Authenticated>
<Unauthenticated>
*** THIS COMPONENT ALWAYS STAYS ON THE SCREEN ***
<SignIn />
</Unauthenticated>
</ScrollView>
</SafeAreaView>
)
}
2 Replies
Convex Bot
Convex Bot3mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
stefandjokic
stefandjokicOP3mo ago
What I can also provide is this: when I call: signIn("password", { email, password, flow: "signIn" }), the response object is: {"signingIn": true} But still nothing happens on the FE

Did you find this page helpful?