<np-login>
Description | Overview |
---|---|
An input component to authenticate a user using an authentication link or passkeys (if registered). |
Usage:
Properties
Name | Format | required | default | Description |
---|---|---|---|---|
id | text | no | ”input” | The input component id. |
value | no | undefined | The user’s email. | |
placeholder | text | no | ”Your email” | The input field placeholder. |
passkeys | boolean | no | undefined | True if passkeys is supported and ready to authenticate. |
state | State | no | undefined | The component’s internal state. |
lifetime | number | no | ”86400” (24h) | The session maximum duration in seconds |
idletimeout | number | no | lifetime | The session inactivity timeout in seconds |
Methods
Name | Description |
---|---|
loginWithEmail() | Starts programmatically the email link login flow. Don’t forget to set the email property before calling it. |
getSession() | Returns the current session (Promise<Session> ). Null if not authenticated. |
Custom Events
Name | Description | Type |
---|---|---|
np:login | The user has been authenticated. | Session |
np:error | Something went wrong. | NoPwdError |
The np:login
custom event detail is defined as follow:
The np:error
custom event detail inherites from the NoPwdError
.
Parts
Name | Description |
---|---|
input | The component’s input wrapper. |
button | The component’s button wrapper. |