Skip to content

PasswordUI

Reference doc for the `PasswordUI`.

Configure the UI that’s used by the Password provider.

import { PasswordUI } from "@openauthjs/openauth/ui/password"
import { PasswordProvider } from "@openauthjs/openauth/provider/password"
export default issuer({
providers: {
password: PasswordAdapter(
PasswordUI({
copy: {
error_email_taken: "This email is already taken."
},
sendCode: (email, code) => console.log(email, code)
})
)
},
// ...
})

Methods

PasswordUI

PasswordUI(input)

Parameters

Returns PasswordConfig

Creates a UI for the Password provider flow.

PasswordUIOptions

Configure the password UI.

PasswordUIOptions.copy?

Type Object

Custom copy for the UI.

PasswordUIOptions.copy.button_continue

Type string

Default Continue

Copy for the continue button.

PasswordUIOptions.copy.change_prompt

Type string

Default Forgot password?

Copy for the forgot password link.

PasswordUIOptions.copy.code_resend

Type string

Default Resend code

Copy for the resend code button.

PasswordUIOptions.copy.code_return

Type string

Default Back to

Copy for the “Back to” link.

PasswordUIOptions.copy.error_email_taken

Type string

Default There is already an account with this email.

Error message when email is already taken.

PasswordUIOptions.copy.error_invalid_code

Type string

Default Code is incorrect.

Error message when the confirmation code is incorrect.

PasswordUIOptions.copy.error_invalid_email

Type string

Default Email is not valid.

Error message when the email is invalid.

PasswordUIOptions.copy.error_invalid_password

Type string

Default Password is incorrect.

Error message when the password is incorrect.

PasswordUIOptions.copy.error_password_mismatch

Type string

Default Passwords do not match.

Error message when the passwords do not match.

PasswordUIOptions.copy.input_code

Type string

Default Code

Copy for the code input.

PasswordUIOptions.copy.input_email

Type string

Default Email

Copy for the email input.

PasswordUIOptions.copy.input_password

Type string

Default Password

Copy for the password input.

PasswordUIOptions.copy.input_repeat

Type string

Default Repeat password

Copy for the repeat password input.

PasswordUIOptions.copy.login

Type string

Default Login

Copy for the login button.

PasswordUIOptions.copy.login_description

Type string

Default Sign in with your email

Description of the login page.

PasswordUIOptions.copy.login_prompt

Type string

Default Already have an account?

Copy for the login link.

PasswordUIOptions.copy.login_title

Type string

Default Welcome to the app

Title of the login page.

PasswordUIOptions.copy.register

Type string

Default Register

Copy for the register button.

PasswordUIOptions.copy.register_description

Type string

Default Sign in with your email

Description of the register page.

PasswordUIOptions.copy.register_prompt

Type string

Default Don’t have an account?

Copy for the register link.

PasswordUIOptions.copy.register_title

Type string

Default Welcome to the app

Title of the register page.

PasswordUIOptions.sendCode

Type (email: string, code: string) => Promise<void>

Callback to send the confirmation code to the user.

async (email, code) => {
// Send an email with the code
}