π Login System Overview
The platform includes a built-in authentication system that supports both email/password login and a selection of custom providers.
You can enable or disable each method in the config, giving you full control over how users log in.
βοΈ Enabling Providers
In the config, youβll find toggles for each provider.
To use a custom provider (like Google, GitHub, etc.), you'll need to provide:
CLIENT_IDCLIENT_SECRET
When a provider is enabled, the login form will automatically update to include it. β
π§ Session Data
Once a user logs in, some default values are added to their session:
token: A string used to look up the session in server storage.location: An object containing:pathName: The current route as a string (e.g./dashboard)searchParams: The query string from the URL converted into an object.
π€ User Data Defaults
You can customize what user data is stored in the session by editing the userdata section in your config.
By default, this includes:
id --stringname -- stringemail -- stringprovider --stringadmin -- boolean @default(false)avatar -- stringlanguage -- string @default('en')createdAt -- DateupdatedAt -- DateToken -- stringlocation: { pathName: string; serachParams: Record<string, any> }
π§© We allow multiple accounts to exist under the same email as long as they use a different provider. To support this, the email + provider combination is used as a unique identifier.
β If you remove email or provider from the sessionLayout youβll need to update the server logic to reflect that. Removing them without doing so may break the system.
Last updated