Skip to content

Features

Password reset

Included free on every install.

Password reset is the "forgot password" flow for LyEve Console accounts. A person asks for a reset with their email address, receives a link that works once for one hour, and sets a new password with it. Setting the new password signs the account out of every device.

  1. On the sign-in page, choose Forgot password?.
  2. Enter the account's address and choose Email me a reset link. If your organization's identity provider created the account and the console's address does not already name your organization, enter its short name in Organization (optional). The console shows that field when it runs with SIGN_IN_ORGANIZATION=true.
  3. Open the link from the email. On Choose a new password, enter the password in New password and Confirm new password, then choose Save.

The console checks that the password has at least 12 characters before it sends the token, so a password that is too short does not spend the link. The engine then applies the install's password policy, so a PASSWORD_MIN_LENGTH above 12 asks for more.

The Reset your password page with an email address entered, the Organization (optional) field and the Email me a reset link button.

StepWhat happens
RequestThe console posts the address, and the organization when one was entered, to /api/admin/auth/password-reset/request. The answer is the same, in about the same time, whether or not the account exists, and whether or not another tenant holds the address. A new request cancels the account's earlier unused links.
EmailThe link <LYEVE_CONSOLE_URL>/reset-password?token=<token> is mailed. When the account has a tenant, the link adds &tenant=<tenant>. A console that runs with SIGN_IN_ORGANIZATION=true carries it on to the sign-in page, which fills in the organization, and any other console ignores it.
ConfirmThe person chooses a new password, and the console sends it with the token. The engine holds it to the install's password policy before it reads the token, so a refused password leaves the link usable. The account is checked again, so a link mailed before the account was disabled, or before its sign-in window closed, sets no password.
Sign-outEvery session and refresh token the account held ends.

Password reset runs on every install. To deliver the email, give the instance a mail relay. With the email feature configured, the mail goes through it and is the tenant's password-reset template, so its wording and design are yours to change. See required templates. Otherwise the instance's own SMTP settings are used. A relay on loopback or a private network also needs SMTP_ALLOWED_PRIVATE_NETWORKS, as send through one relay explains. Set LYEVE_CONSOLE_URL to the address people open the console at, such as https://admin.example.com. In production, password reset refuses to start without it.

With no relay configured, a request still answers 200 and no mail is sent. The server log records that a token was issued, with only its first eight characters.

Console v0.28.0

  1. On the console's sign-in page, choose Forgot password?.
  2. Enter your address in Email and choose Email me a reset link. The page says a reset link is on its way if an account exists for that address.
  3. Open the link from the email. On Choose a new password, enter short in both fields and choose Save. The page says Use at least 12 characters. and keeps the link usable.
  4. Enter A-new-Password-2026 in New password and Confirm new password, then choose Save. The page says the password changed and asks you to sign in with the new one.

Engine API v0.62.0

Both routes are public and take no Authorization header.

  1. Ask for a reset:

    Shell
    curl -X POST http://localhost:3001/api/admin/auth/password-reset/request \
    -H "Content-Type: application/json" \
    -d '{"email": "you@example.com"}'
    JSON
    { "message": "If an account with that email exists, a password reset link has been sent." }

    An account that a tenant's identity provider created is reached only through its tenant. When the hostname you call does not name that tenant, add "tenant": "<tenant slug>" to the body. A tenant the hostname names wins over the field.

  2. Open the email and copy the token from the link.

  3. Try a password that is too short. The token is not spent:

    Shell
    curl -X POST http://localhost:3001/api/admin/auth/password-reset/confirm \
    -H "Content-Type: application/json" \
    -d '{"token": "<token from the link>", "password": "short"}'
    JSON
    { "error": "Password must be at least 12 characters.", "code": "AUTH_PASSWORD_TOO_SHORT" }

    The answer is 422.

  4. Set the new password:

    Shell
    curl -X POST http://localhost:3001/api/admin/auth/password-reset/confirm \
    -H "Content-Type: application/json" \
    -d '{"token": "<token from the link>", "password": "A-new-Password-2026"}'
    JSON
    { "message": "Password has been reset successfully." }
  5. Send the same token again. The answer is 400 with invalid or expired reset token, even when two confirms arrive at once.

The new password has to pass the same policy as a new account's: PASSWORD_MIN_LENGTH, PASSWORD_REQUIRE_COMPLEXITY, PASSWORD_CHECK_COMMON and the 72-byte limit. With the defaults, a password of lower-case letters, digits and hyphens alone, such as a-new-password-2026, is refused with AUTH_PASSWORD_NEEDS_COMPLEXITY. A refusal names the rule in code, and the link stays usable for a better password. The account is now signed out everywhere, and the new password signs it in.

VariableWhat it doesDefault
SMTP_HOSTMail relay host. Without it and without the email feature, no mail is sent.unset
SMTP_PORTRelay port.587
SMTP_FROMSender address.unset
SMTP_USER, SMTP_PASSRelay credentials. Both must be set to authenticate.unset
LYEVE_CONSOLE_URLThe console address the link points to. Required in production, where it must use https.http://localhost:5173 outside production

If you set LYEVE_PLUGINS, include password-reset in it.

LimitDefault
Link lifetime1 hour
New passwordThe install's password policy, as for a new account. See Configuration.
Reset requests per client address (password-reset.ip)10 per minute
Reset mails per email address (password-reset.email)1 per 5 minutes
Request route, per client address3 per second, burst 5
Confirm route, per client address5 per second, burst 10

A super admin can change the two named limits on the rate limiting page. A request over the per-address mail limit still answers 200 and sends nothing, so the limit reveals nothing about the account. PUBLIC_RATE_LIMITS changes the two per-route limits.

Spent and expired tokens are deleted by a daily sweep. Deleting a tenant, or a privacy erasure, deletes them at once.

Errors answer a JSON body with an error message.

StatusMessageCause
400invalid or expired reset tokenThe token is wrong, expired or already used, or the account was disabled or left its sign-in window after the link was sent. Request a new link.
422AUTH_PASSWORD_TOO_SHORT, AUTH_PASSWORD_NEEDS_COMPLEXITY, AUTH_PASSWORD_TOO_COMMON or AUTH_PASSWORD_TOO_LONG in codeThe new password fails the install's password policy. The link is not spent.
503password reset is not configuredLYEVE_CONSOLE_URL is not set.
Every other error
StatusMessageCause
400invalid JSONThe body is not JSON.
400A validation error with a fields objectA field is missing, or email is not an address.
429too many requestsOver 10 requests a minute from one client address.
429rate limit exceededOver a per-route limit.
  • No email arrives. Check that SMTP_HOST is set, or that the email feature is configured, and look in the server log for failed to send email. A log line with SMTP host resolves to a restricted address means the relay is on a private network that SMTP_ALLOWED_PRIVATE_NETWORKS does not list.
  • The link points to the wrong address. Set LYEVE_CONSOLE_URL to the console's public URL.
  • No email arrives for an account an identity provider created. The request has to name the account's tenant, by hostname or by tenant. The account also gets no mail when the provider has not signed it in within the tenant's sign-in window, or when the directory deactivated it.
  • Password reset is missing. In production it does not start without LYEVE_CONSOLE_URL. The server log names the setting at startup.