Google OAuth is the default, but the architecture extends to other OAuth providers
(GitHub, Microsoft) by adding additional blueprints.
Setup
1
Create OAuth credentials
Create them at the
Google Cloud Console.
2
Add the redirect URI
http://localhost:5173/auth/google/callback for development, or your production URL.3
Add credentials to .env
.env
4
Create your admin user
Routes
Approval workflows
When users first authenticate, Feather can either auto-approve them or hold them for admin review.
Manual approval creates new users in a suspended state. They see a pending-approval
page until an admin approves them in the admin panel. This
prevents drive-by signups and gives you explicit control over who uses the application.
Auto-approve activates new users on first login. Selecting it during scaffolding sets
AUTO_APPROVE_USERS = True in your config.py and the framework handles the rest — no
callback files or environment variables needed.
Status pages
These pages are scaffolded with friendly messages and logout buttons. They use
@login_only so users stay authenticated while seeing their account status. Edit the
templates in templates/pages/account/ to match your branding.
Decorators
Which one to use
Roles
These defaults cover most apps, but you can add, remove or rename them.
Roles inherit permissions, so
@role_required('editor') allows both editors and admins.
To customize, edit the hierarchy in feather/auth/roles.py:
@role_required('reviewer'). The User model’s role field is a simple
string, so no migration is needed when adding roles.
Permissions
CRUD-based access control that maps onto roles.feather/auth/permissions.py and extend the same way roles
do.
Seeds
seeds.py populates initial data. The scaffolded version creates your admin user with
the email you provided during feather new. Extend it for your own data:
seeds.py
python seeds.py or feather db seed. The scaffolded seed is
idempotent — it updates existing users rather than creating duplicates.
Callbacks
Post-login callback
Post-login callback
For B2B and B2C apps that need custom account setup after OAuth.Use this for creating Account or Membership records, assigning tenants to public
email users, or custom onboarding flows.
.env
myapp/auth.py
Pre-register callback
Pre-register callback
Block new registrations before the account is created. Runs during OAuth signup
only for new users — existing users logging in are unaffected.Returning a string blocks registration — the message is shown as a toast error and
no user record is created. Returning
.env
myapp/auth.py
None (or raising) lets registration proceed.
Errors in the callback are logged but do not block signups.