ForgeWP

Configuration & Admin Settings

Auth defaults, installed overrides, metadata ownership, and email text.

Configuration and admin settings

Configure initial defaults under auth in wp.config.ts. Installing the Auth dependency in the theme also enables generated Auth integration. WordPress options saved by administrators take priority over the corresponding source defaults.

scripts/auth-policy.ts
1import { defineConfig } from "@forgewp/compiler"
2
3export default defineConfig({
4  name: "Member Theme",
5  slug: "member-theme",
6  version: "1.0.0",
7  description: "A membership theme",
8  textDomain: "member-theme",
9  configVersion: 1,
10  auth: {
11    loginField: "usernameAndEmail",
12    defaultRole: "subscriber",
13    registrationMetaFields: ["first_name"],
14    reservedUsernames: ["admin", "root", "system"],
15    features: {
16      registration: true,
17      emailVerification: true,
18      blockLoginUntilVerified: true,
19      autoLoginAfterSignup: false,
20    },
21    emails: {
22      verification: {
23        subject: "Verify your account",
24        body: "Hello {username}, open {verification_url}",
25      },
26      passwordReset: {
27        subject: "Reset your password",
28        body: "Hello {username}, open {reset_url}",
29      },
30    },
31  },
32})

This is a complete typed configuration example. Apply its auth property to your theme's existing wp.config.ts; a separate script file is not automatically discovered as theme configuration.

Table · 3 columns
Source path under auth
Default
Installed option
loginField
usernameAndEmail
forgewp_auth_login_field
defaultRole
subscriber
forgewp_auth_default_role
features.registration
true
forgewp_auth_registration_enabled
features.emailVerification
false
forgewp_auth_email_verification_enabled
features.blockLoginUntilVerified
false
forgewp_auth_block_login_until_verified
features.autoLoginAfterSignup
true
forgewp_auth_auto_login_after_signup
emails.verification.subject
Please Verify Your Email
forgewp_auth_verification_email_subject
emails.verification.body
Built-in verification message/link
forgewp_auth_verification_email_body
emails.passwordReset.subject
Password Reset Request
forgewp_auth_password_reset_email_subject
emails.passwordReset.body
Built-in recovery message/link
forgewp_auth_password_reset_email_body

Administrators with manage_options edit these at Settings → ForgeWP Auth. Boolean policy options are stored as WordPress string values; use booleans in source configuration. Re-exporting does not replace saved settings with new source defaults.

registrationMetaFields defaults to an empty list and remains developer-owned. It allows selected scalar public profile inputs; protected role/capability/session/ForgeWP keys cannot be listed. reservedUsernames defaults to admin, system, root and is developer-owned. These arrays do not generate form controls or admin editors.

Check both places when behavior differs

Source config supplies defaults for an installation; the installed settings describe the current site's policy. Verify saved options before diagnosing a source-default change as ineffective.

Verification email bodies support {username}, {email}, {verification_url}. Recovery bodies support {username}, {reset_url}. These are Auth-specific replacements, separate from native-form JSON template validation. Email subjects are configured text; do not assume body placeholders also interpolate in subjects.

Headless settings

headless.apiUrl selects a separately configured backend base and headless.jwtAuth enables the optional JWT integration. Those are top-level theme settings, outside auth. They do not install or configure a token plugin on the backend. See Deployment.