runlot
DataAuth

Auth

Sign up your app's users and check whether they are logged in. The user table lives in your project database, and default login and sign-up screens are included.

runlot.json
{ "auth": true }
runlot deploy

Once you deploy, you get the following.

  1. env.auth, for use inside your worker
  2. Login and sign-up screens served from your app at /__runlot/auth/*
const user = await env.auth.user(request);
if (!user) return Response.redirect("/__runlot/auth/sign-in");

Auth is not access control

FeatureWhat it doesWho it applies to
Auth (this page)Identifies your app's users through env.authYour app's users
Access controlLimits who can reach the deployment itselfYour team, anyone who knows the password, or every visitor

For example, showing a pre-launch deployment only to members of your organization is access control. Identifying which user is logged in to the app inside that deployment is auth. The two are independent of each other.

The user table lives in your project database

User records are stored in the runlot_auth schema of your project database. You can query them with psql or join them against your own tables.

select id, email, created_at from runlot_auth.users order by created_at desc limit 20;

Passwords and session tokens are stored only as hashes.

In this section

Getting started

Operating

Reference

On this page