Session-Based Authentication
Featul uses better-auth for session-based authentication. All authenticated requests include session cookies that are validated on the server.Authentication Methods
- Email/Password with OTP verification
- Google OAuth
- GitHub OAuth
- Cross-subdomain cookies for multi-tenant workspaces
Procedure Types
All API endpoints are defined as either public or private procedures:Public Procedures
Public procedures can be called without authentication:workspace.bySlug- Get workspace detailsboard.byWorkspaceSlug- List public boardspost.create- Create a post (may allow anonymous)post.vote- Vote on a post (may allow anonymous with fingerprint)comment.list- List comments on a post
Private Procedures
Private procedures require authentication and will return a 401 error if the session is invalid:workspace.create- Create a workspaceworkspace.update*- Update workspace settingsboard.settingsByWorkspaceSlug- Get board settingspost.update- Update a postpost.delete- Delete a postcomment.update- Update a comment
Authentication Flow
The authentication flow is handled automatically:- User signs in via better-auth
- Session cookie is set (works across subdomains)
- Client automatically includes cookie in all requests
- Server validates session in
authMiddleware - Session data is available in
ctx.session
Server-Side Session Access
Anonymous Operations
Some operations support anonymous users with fingerprinting:Anonymous Posting
Boards can allow anonymous posts if configured:Anonymous Voting
Voting works for both authenticated and anonymous users:Permission Levels
Authenticated users have different permission levels within workspaces:Workspace Owner
- Full control over workspace
- Can delete workspace
- Can manage billing
- All permissions below
Admin
- Can manage members
- Can configure boards
- Can moderate all content
- All permissions below
Member
- Can create posts
- Can comment
- Can vote
- Limited moderation
Viewer
- Can view content
- Can vote (if board allows)
- Cannot create or edit