Sign in
A sign-in card. By default its button sends the person to your organization's hosted sign-in page.
Installation
- npm
- pnpm
- Yarn
- Bun
npm install @lumoauth/react
pnpm add @lumoauth/react
yarn add @lumoauth/react
bun add @lumoauth/react
The component needs a LumoAuthProvider above it.
Usage
import { SignIn } from '@lumoauth/react';
export default function SignInPage() {
return <SignIn afterSignInUrl="/dashboard" signUpUrl="/sign-up" />;
}
When the person is already signed in, the component renders nothing.
How it signs in
The provider decides, with its authStrategy prop.
| Strategy | What the card shows | Where the password is typed |
|---|---|---|
pkce (default) | One button. It starts the authorization code flow with PKCE. | On the hosted sign-in page of your organization, with every method that you turned on: passkeys, magic links, social sign-in, MFA. |
password | An email field and a password field. | In your app. The form calls the OAuth password grant, which LumoAuth does not offer, so a sign-in from it fails. |
Keep the default, pkce. A method that you turn on in the portal then appears for your users without a change to your app.
A program that is not a web page can sign a person in without the hosted page. The recipe Sign in with a form in your app shows how, and why a web page cannot do it.
Examples
Social sign-in buttons
Each button goes straight to that provider. A provider that your organization has not turned on opens the hosted sign-in page.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
afterSignInUrl | string | Where to go after sign-in. Defaults to the afterSignInUrl of the provider. | |
signUpUrl | string | The address of your sign-up page, for the link under the card. | |
socialProviders | string[] | [] | Providers to offer as buttons, for example ['google', 'apple']. There is no default list, because the card cannot read which providers your organization turned on. Icons exist for google, github, microsoft and apple. Any other value gets a label and no icon. |
appearance | AppearanceProps | Theme, CSS variables and class name for this card. See Theming. |
Theming
The card reads the --la-* variables. See Theming for the list and a styled example.