Skip to main content

Sign in

A sign-in card. By default its button sends the person to your organization's hosted sign-in page.

ComponentReadyView source
Works with
ReactNext.js

Installation​

npm install @lumoauth/react

The component needs a LumoAuthProvider above it.

Usage​

src/pages/SignIn.tsx
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.

StrategyWhat the card showsWhere 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.
passwordAn 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​

PropTypeDefaultDescription
afterSignInUrlstringWhere to go after sign-in. Defaults to the afterSignInUrl of the provider.
signUpUrlstringThe address of your sign-up page, for the link under the card.
socialProvidersstring[][]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.
appearanceAppearancePropsTheme, 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.