You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Login with `remember: true` creates a persistent token in `{prefix}remembers` and sets an httpOnly cookie. On future requests, the middleware auto-restores the session from the cookie.
37
+
See the [MFA Patterns](../guides/mfa.md) guide for full implementation examples including OTP delivery.
73
38
74
-
Configure the duration and cookie name in `AuthConfig`:
39
+
## Remember Me
75
40
76
-
```typescript
77
-
const authConfig = {
78
-
db: pool,
79
-
rememberDuration: "30d",
80
-
rememberCookieName: "remember_token",
81
-
};
82
-
```
41
+
Login with `remember: true` creates a persistent token in `{prefix}remembers` and sets an httpOnly cookie. On future requests, the middleware auto-restores the session from the cookie. Configure `rememberDuration` and `rememberCookieName` in `AuthConfig`.
Copy file name to clipboardExpand all lines: docs/docs/concepts/sessions.md
+1-14Lines changed: 1 addition & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,17 +32,4 @@ On subsequent requests, the middleware checks for the cookie and restores the se
32
32
33
33
## Activity Logging
34
34
35
-
The `ActivityLogger` records actions like login, failed login, 2FA prompts, remember token creation, role changes, and more. It parses user agent strings for browser/OS/device info and stores metadata as JSON.
36
-
37
-
Activity logging is enabled by default. Configure it in `AuthConfig`:
The `ActivityLogger` records actions like login, failed login, 2FA prompts, remember token creation, role changes, and more. It parses user agent strings for browser/OS/device info and stores metadata as JSON. Activity logging is enabled by default. See the [Express Middleware](../guides/express-middleware.md) guide for configuration options.
`defineRoles` assigns sequential powers of 2. The admin UI and `getRoleNames()` use whatever you define here. If you don't set `roles`, the built-in `AuthRole` enum (21 predefined roles) is used.
62
+
The admin panel is served from your Express app. It reads your auth config, so custom roles and all user data show up automatically.
0 commit comments