-
Notifications
You must be signed in to change notification settings - Fork 0
Authentication
Tom Caswell edited this page May 2, 2026
·
1 revision
Client authentication is handled by the Caswell_Auth class in includes/class-auth.php. The plugin implements its own registration, login, password reset, and email verification flows via AJAX-Endpoints.
The plugin registers a custom WordPress role: caswell_client. This role has read-only capabilities, giving clients just enough access to manage their own bookings through the [caswell_account] shortcode without access to the WordPress admin dashboard.
- Client requests a reset via the
caswell_forgot_passwordAJAX action. - A time-limited token is generated, hashed with SHA-256, and stored in user meta.
- An email containing a reset link is sent to the client.
- The client submits their new password with the token via the
caswell_reset_passwordaction. - The token and expiry are validated before the password is updated.
| Meta Key | Purpose |
|---|---|
_caswell_reset_token |
SHA-256 hash of the reset token |
_caswell_reset_expiry |
Expiration timestamp for the reset token |
Email verification follows a similar token-based flow:
- A verification token is generated and stored in user meta.
- A verification email is sent to the client.
- The client clicks the link (or requests a resend via
caswell_verify_email). - The token is validated and the email is marked as verified.
| Meta Key | Purpose |
|---|---|
_caswell_verify_token |
SHA-256 hash of the verification token |
_caswell_verify_expiry |
Expiration timestamp for the verification token |
- AJAX-Endpoints — All auth-related AJAX actions
- Admin-Settings — Email configuration for reset and verification messages
Getting started
How it works
- Architecture
- Database Schema
- Scheduling
- Google Calendar
- Notifications
- Email Deliverability
- Authentication
- AJAX Endpoints
Payments
Other