Auth screen
This screen lets a user sign in or register. If a user has never signed in before, it will show the registration screen, otherwise it will show the sign in screen.
Example usage
Here is a simplified version of how this component is used in the template app:
import { useAuthState, AuthProvider } from '@healthblocks-io/core/auth'
function App() {
return (
<AuthProvider>
<Screens />
</AuthProvider>
)
}
function Screens() {
const auth = useAuthState()
if (!auth) return <Auth />
return <View>Signed in!</View>
}
Props
allowNavigation- Boolean(true): Allow users to switch between SignIn and RegisterautoFocus- Boolean(false): Focus the first input fieldcontainerStyle- ViewStyle: Override styles of the scroll content containerinitialRouteName-'SignIn' | 'Register': Choose the route for the initial rendersignupFields- FC: Add extra fields to the sign up form.
Translation keys
This page contains the following translation keys:
Invalid codeSignin successfulRegisterEmail addressEnter your email addressPasswordChoose a passwordHave account alreadySign inInvite code requiredEnter your codeAnonymous loginCode validContinueVerify codeForgot passwordRequest password resetEmail sent!We sent you an email with instructions.Return toEnter your passwordUnexpected errorSigning inNo account yetReset your passwordResetting passwordReset password