VoiceLink Admin Authentication System

VoiceLink Admin Authentication System

Overview

Dual authentication system supporting both local email/password accounts and Mastodon OAuth, with account linking capabilities.

Authentication Methods

1. Email/Password Authentication

2. Mastodon OAuth Authentication

3. Account Linking

Role Hierarchy

| 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 |

Database Schema (Server-Side)

// 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: { ... }

}

Client-Side Implementation

Login Modal UI

+------------------------------------------+
|           VoiceLink Login                |
+------------------------------------------+
|                                          |
|  [Tab: Email] [Tab: Mastodon]            |
|                                          |
|  --- Email Login ---                     |
|  Email: [_______________________]        |
|  Password: [___________________]         |
|  [ ] Remember me                         |
|                                          |
|  [Login] [Create Account]                |
|                                          |
|  --- Or continue with ---                |
|  [🐘 Login with Mastodon]                |
|                                          |
|  Forgot password?                        |

+------------------------------------------+

Admin Panel Access

API Endpoints (Server)

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

Implementation Files

New Files to Create:

Files to Modify:

Security Considerations

Migration Path

Admin Roles from auth.devinecreations.net

If integrating with a central auth server:

Implementation Priority