Skip to main content
Keyline

Sign-in, sign-up and recovery screens, ready to wire up.

Keyline is an authentication starter kit in HTML, Bootstrap 5 and vanilla JavaScript. Every screen works today against a demo store, and a single file swaps that store for your API.

Demo account: demo@gmail.com with password edinstack

How the screens connect
  1. Create account
  2. Verify email
  3. Sign in
  4. Two-step code if turned on
  5. Account
Forgot password from sign in
  1. Request code
  2. Enter code
  3. New password

Screens in the kit

Eight pages, each with loading, error and empty states already handled.

Sign in

Email and password, remember me for 30 days, password visibility toggle, Caps Lock warning, lockout after 5 failed tries.

pages/login.html

Create account

Live validation, password strength meter with a requirement checklist, confirm password, plan picker in pesos, terms checkbox.

pages/register.html

Verify email

Inbox prompt after sign-up or an unverified sign-in, with a resend button on a 60-second cooldown.

pages/verify-email.html

Email verified

Landing page for the link in the email. Handles valid, used and expired links.

pages/email-verified.html

Forgot password

Sends a reset code without revealing whether the email has an account.

pages/forgot-password.html

One-time code

Six-box input with paste and autofill support, 5-minute expiry, resend cooldown, 5 attempts. Used for resets and two-step sign-in.

pages/otp.html

New password

Only opens after a correct code, expires after 15 minutes, signs the account out everywhere on save.

pages/reset-password.html

Account

Protected page with two-step verification switch, remembered device status, plan in pesos and recent sign-in activity.

pages/dashboard.html

Connect it to your backend

The pages never touch storage directly. They call AuthService, so that is the only file you rewrite.

  1. Copy the files

    Drop pages/ and assets/ into your project, or move the markup into your own layout and keep the script tags.

  2. Replace the service methods

    Each method in assets/js/core/auth-service.js returns a Promise. Swap the body for a fetch to your API and throw an AuthError with a code the pages already understand.

  3. Remove the demo inbox

    Delete assets/js/core/demo-inbox.js and its script tags. Your server sends the real emails.

  4. Guard pages on the server

    The account page check in the browser is a convenience. Protect routes and APIs with your session cookie.

async function login(email, password, remember) {
  const res = await fetch('/api/auth/login', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    credentials: 'include',
    body: JSON.stringify({ email, password, remember })
  });
  const data = await res.json();
  if (!res.ok) throw new AuthError(data.code, data.message);
  return data; // { next: 'dashboard' } or { next: 'otp' }
}