The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
Login and Registration

On a wide screen (1024 pixels and up) the left side of the page shows an animated dot map of the world on which routes light up between cities, with the tagline Your Trips. Your Plan. and a short description. The sign in card sits on the right. On narrower screens the panel is hidden and the card is shown under the TREK logo.
Signing in
Navigate to /login and enter your email and password. On success, the server sets a trek_session cookie (httpOnly, sameSite=lax, and secure in production) that keeps you signed in across page reloads. How long it survives depends on the Remember me switch, described below. You do not need to sign in again until the session expires or you explicitly log out.
Note: The
secureflag on the cookie can be overridden by settingCOOKIE_SECURE=falsein the server environment (useful for plain-HTTP dev setups), or force-enabled withFORCE_HTTPS=true.
If your account has two-factor authentication enabled, you are prompted for a TOTP code (or backup code) after the password step before the session cookie is issued.
If you have forgotten your password, click the "Forgot password?" link below the password field to start the self-service reset flow. See Password-Reset for details.
Remember me
The Remember me switch below the password field decides how long the session lives:
- Off (the default): a browser-session cookie with no
maxAge, cleared when you close the browser, backed by a token valid forSESSION_DURATION(default24h). - On: a persistent cookie matching a token valid for
SESSION_DURATION_REMEMBER(default30d), so the session survives browser restarts.
Both durations are configurable per instance, see Environment-Variables. Your choice is carried through the MFA step, through a password change, and through SSO sign-in. While you keep using TREK the cookie is silently re-issued once the token is past half its lifetime, with the same Remember me semantics, so an active session never expires mid-use. Only cookie sessions are renewed this way; API and MCP clients authenticating with a bearer token are not.
Sign-ins that never pass through this switch (registration, the demo button and passkey sign-in) get the historical default instead: a persistent cookie lasting SESSION_DURATION.
Forced password change
Some accounts are flagged as needing a new password: the admin account TREK seeds on first boot always is, and so is an account restored with the reset-admin.js recovery script (see Troubleshooting). For those accounts a Set new password form is shown immediately after a successful login (or after the MFA step). The session cookie has already been issued at that point; the app simply keeps you on the form until the new password is saved, and saving it re-issues the cookie and signs your other sessions out.
There is no control in the Admin Panel that flags an existing account. An admin-set password (see Admin-Users-and-Invites) neither raises the flag nor clears it, so a user who already carries it is still asked to choose their own password at the next sign-in.
Signing out
Logging out ends the session on the server, not only in this browser: the token behind the cookie stops working wherever a copy of it may be. Each sign-in is its own session, so logging out on the laptop leaves the phone signed in.
To end sessions on other devices, the API offers GET /api/auth/sessions (the signed-in sessions with their browser and last use), DELETE /api/auth/sessions/{id} (end one) and POST /api/auth/sessions/revoke-others (end all but this one). The settings screen has no list of sessions yet. Changing the password also signs out every other device. Which other actions end sessions is listed under Security-Hardening.
Registering
The Register form appears under one of these conditions:
- Open registration: the admin has enabled password registration for the instance (
password_registrationsetting). - Valid invite link: you visited
/register?invite=TOKENwith a valid token (see below). - No accounts at all: nobody has signed up yet; the registration form is shown automatically and the first account created becomes an admin. On a normal install this never happens, because TREK seeds an admin on first boot (see First run below).
Registration fields: username, email, and password.
Password requirements
Passwords must meet all of the following rules:
- Minimum 8 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character
- Must not be a commonly used password
- Must not consist of a single repeated character
As soon as you start typing, the five character rules appear under the password field as a checklist (At least 8 characters, An uppercase letter, A lowercase letter, A number, A special character), and each one is ticked off once the password meets it. The same checklist appears on every form that sets a password: registration, the forced password change, the reset page, Change Password in Settings and the admin's user dialogs. The common-password and repeated-character checks run when you submit.
Admin: You can disable open registration so only invite links work: switch off Password Registration in Admin → Settings, card Authentication Methods. See Admin-Users-and-Invites.
Invite link flow
When an admin shares an invite link (/register?invite=TOKEN), visiting it:
- Validates the token against the server.
- Switches the login page to Register mode automatically.
- Passes the token during registration so it counts against the invite's use limit.
If the token is invalid, expired, or exhausted, an error is shown.
First run
On a normal install TREK seeds an admin account on first boot, before anyone can register, so the login page opens in Sign In mode and the Register link is hidden. The credentials depend on how you start the container:
- With both
ADMIN_EMAILandADMIN_PASSWORDset, those values are used. - With only one of the two set, both are ignored (a warning is logged) and the generated credentials below are used instead.
- Otherwise the account is
[email protected], usernameadmin, with a randomly generated password printed to the container log; rundocker logs trekto retrieve it.
If no user exists at all, the page opens on a Create Admin Account form instead: "Set up the first admin account for TREK." The account created there is the admin.
The seeded admin is flagged as requiring a password change, so you are forced to set a new password on first sign-in. Until that happens the Register link stays hidden even though password registration is enabled by default; once the password is changed the link appears normally.
Two setups skip the seeder entirely. DEMO_MODE=true seeds the demo data instead (see Demo-Mode), and on an OIDC-only install no local account is created at all; there the first user who signs in through the identity provider is assigned the admin role.
See Quick-Start for the full first-boot walkthrough.
Sign-in over plain HTTP
If you reach TREK over plain HTTP, the browser drops the secure session cookie and the next request fails with "Access token required". After such a sign-in the page shows a warning, Login won't stick over HTTP, with an Open the Troubleshooting guide link. Use HTTPS, or for a home lab set COOKIE_SECURE=false. See Troubleshooting.
Rate limiting
Requests to the login endpoint are rate-limited to 10 per 15-minute window per IP address. The counter is incremented before the credentials are checked, so successful sign-ins count against it too, not only failed ones. After exceeding the limit, further requests return HTTP 429 until the window resets. The window is fixed from the first counted request, and blocked requests do not extend it.
That counter is shared rather than per-endpoint. POST /api/auth/login, POST /api/auth/register, GET /api/auth/invite/:token and the passkey sign-in ceremony each allow 10 requests from it; PUT /api/auth/me/password, POST /api/auth/mfa/disable, POST /api/auth/mcp-tokens and passkey deletion draw on the same counter but are rejected once it reaches 5. Unrelated activity from the same IP therefore eats into the allowance: ten registration attempts will 429 the next login, and five requests of any kind will 429 a password change.
MFA verification attempts are rate-limited separately to 5 attempts per 15-minute window per IP address.
Forgot-password requests are rate-limited to 3 attempts per 15-minute window per IP. Reset-password submissions are limited to 5 attempts per 15-minute window per IP.
Demo mode
When the server is started with DEMO_MODE=true, a Try the demo button ("no registration needed") appears below the login form. Clicking it signs you in as the demo user without entering credentials. The demo credentials ([email protected] / demo12345) are also part of the app config for reference, but the one-click button is the intended entry point. See Demo-Mode.
SSO
If the admin has configured OpenID Connect, a "Sign in with SSO" button (labelled with the configured OIDC_DISPLAY_NAME, defaulting to SSO) appears below the login form. See OIDC-SSO for details on setup and the sign-in flow.
If the identity provider's answer cannot be used, the login page shows why: registration is disabled for this instance, the provider sent no email address, the provider has not confirmed the email address so it cannot be linked to an existing account, or the sign-in could not be linked to the existing account with that email and your administrator has to confirm the address.
When OIDC-only mode is active (password login disabled), visiting /login automatically redirects the browser to the identity provider. The page only says where it is going ("Taking you to Keycloak…", with the configured display name) and offers nothing to fill in; should the redirect not have happened after eight seconds, a link to continue appears. The email/password form is never shown, not even while the page is still asking the server which sign-in it offers: until the answer arrives it shows a short wait, and on a repeat visit it announces the redirect straight away. The automatic redirect is suppressed when you have explicitly logged out, after a failed sign-in at the identity provider, and when the server could not be reached; the SSO button is shown instead so you can choose to sign back in. An admin who wants visitors to see the login page first, with that SSO button, switches off Go straight to SSO under Admin-Settings; the page then never leaves for the identity provider by itself.
See also: OIDC-SSO, Admin-Users-and-Invites, Password-Reset