Dual authentication system supporting both local email/password accounts and Mastodon OAuth, with account linking capabilities.
| Role | Permissions |
|------|-------------|
| Owner | Full system access, can manage admins |
| Admin | Server settings, user management, room control |
| Moderator | Room management, user moderation, kick/ban |
| User | Create rooms, join rooms, basic features |
| Guest | Join public rooms only, limited features |
// users collection
{
id: "uuid",
email: "user@example.com",
passwordHash: "bcrypt_hash",
displayName: "Display Name",
avatar: "url",
role: "admin|moderator|user",
mastodonLinked: {
instance: "mastodon.social",
accountId: "12345",
username: "user",
accessToken: "encrypted_token"
},
createdAt: "timestamp",
lastLogin: "timestamp",
emailVerified: true,
settings: { ... }
}
+------------------------------------------+
| VoiceLink Login |
+------------------------------------------+
| |
| [Tab: Email] [Tab: Mastodon] |
| |
| --- Email Login --- |
| Email: [_______________________] |
| Password: [___________________] |
| [ ] Remember me |
| |
| [Login] [Create Account] |
| |
| --- Or continue with --- |
| [🐘 Login with Mastodon] |
| |
| Forgot password? |
+------------------------------------------+
POST /api/auth/register - Create email account
POST /api/auth/login - Email/password login
POST /api/auth/logout - End session
POST /api/auth/verify-email - Verify email address
POST /api/auth/forgot - Request password reset
POST /api/auth/reset - Reset password with token
POST /api/auth/mastodon/callback - Mastodon OAuth callback
POST /api/auth/link-mastodon - Link Mastodon to existing account
DELETE /api/auth/unlink-mastodon - Unlink Mastodon account
GET /api/auth/me - Get current user info
PUT /api/auth/me - Update user profile
client/js/auth/email-auth.js - Email/password authenticationclient/js/auth/auth-manager.js - Unified auth managerclient/js/ui/login-modal.js - Login/Register UIserver/routes/auth.js - Auth API endpointsserver/models/user.js - User modelclient/js/core/app.js - Integrate new auth systemclient/index.html - Add login modal HTMLclient/css/style.css - Login modal stylesIf integrating with a central auth server: