How badbadtrip/qrauth works
QRAuth is a Lampac plugin that provides a configurable deny/login page and Telegram-based account access and QR sign-in. A visitor requests a short-lived QR session; Telegram users with access can confirm it, while new users can request access for admin approval. Approval writes a token to the shared users file, and the browser uses that token to log in through Lampac. Admins also manage users through the bot. The graph follows README-described capabilities where source excerpts were unavailable; the Lampac core’s polling and login endpoints are external.
Main entry points: qrauthcontroller.cs QR HTTP endpoints · botsession.cs Bot workflows · DenyPageGenerator.cs Deny page generator · modInit.cs Module lifecycle
Components 16
Login experience
- Module lifecycle
modInit.cs - Deny page generator
DenyPageGenerator.cs - Page settings
models/denyPageConf.cs
QR authentication
- QR HTTP endpoints
controllers/qrauthcontroller.cs - Pairing sessions
services/qrauthsessions.cs
Telegram access
- Bot polling host
services/telegrambothostedservice.cs - Bot workflows
services/botsession.cs - Bot settings
models/telegramBotConf.cs
Shared state
- User repository
services/usersrepository.cs - users.json
- Account record
models/lampacUser.cs - Module file log
services/filelog.cs
Other components
- Visitor
- Access admin
- Telegram
- Lampac core
Connections 25
- Module lifecycle → Deny page generator: generates page
- Module lifecycle → Bot polling host: starts service
- Module lifecycle → Page settings: loads settings
- Module lifecycle → Bot settings: loads settings
- Visitor → Deny page generator: opens login page
- Deny page generator → QR HTTP endpoints: requests session
- QR HTTP endpoints → Pairing sessions: creates session
- Deny page generator → QR HTTP endpoints: polls status
- QR HTTP endpoints → Pairing sessions: consumes confirmation
- Deny page generator → Lampac core: logs in with token
- Bot polling host → Bot workflows: dispatches updates
- Bot polling host → Telegram: polls updates
- Bot workflows → Telegram: sends bot messages
- Visitor → Telegram: starts bot
- Access admin → Telegram: manages access
- Bot workflows → User repository: looks up and changes users
- Bot workflows → Pairing sessions: confirms QR login
- QR HTTP endpoints → User repository: looks up login token
- QR HTTP endpoints → Telegram: notifies admins
- User repository → users.json: reads and writes
- User repository → Account record: serializes records
- Lampac core → users.json: polls user records
- QR HTTP endpoints → Module file log: logs failures
- Bot polling host → Module file log: logs bot events
- Bot workflows → Module file log: logs workflow