Skip to main content

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 Register
  • autoFocus - Boolean(false): Focus the first input field
  • containerStyle - ViewStyle: Override styles of the scroll content container
  • initialRouteName - 'SignIn' | 'Register': Choose the route for the initial render
  • signupFields - FC: Add extra fields to the sign up form.

Translation keys

This page contains the following translation keys:

  • Invalid code
  • Signin successful
  • Register
  • Email address
  • Enter your email address
  • Password
  • Choose a password
  • Have account already
  • Sign in
  • Invite code required
  • Enter your code
  • Anonymous login
  • Code valid
  • Continue
  • Verify code
  • Forgot password
  • Request password reset
  • Email sent!
  • We sent you an email with instructions.
  • Return to
  • Enter your password
  • Unexpected error
  • Signing in
  • No account yet
  • Reset your password
  • Resetting password
  • Reset password