(req: IncomingMessage)
| 36 | } |
| 37 | |
| 38 | authenticate(req: IncomingMessage): AuthUser | null { |
| 39 | const session = this.store.getFromRequest(req); |
| 40 | if (!session || !session.encryptedApiKey) return null; |
| 41 | |
| 42 | const apiKey = this.store.decrypt(session.encryptedApiKey); |
| 43 | if (!apiKey) return null; |
| 44 | |
| 45 | return { |
| 46 | id: session.userId, |
| 47 | email: session.email, |
| 48 | name: session.name, |
| 49 | isAdmin: |
| 50 | session.isAdmin || |
| 51 | this.adminUsers.has(session.userId), |
| 52 | apiKey, |
| 53 | }; |
| 54 | } |
| 55 | |
| 56 | setupRoutes(app: Application): void { |
| 57 | const loginHtml = this.loadLoginPage(); |
no test coverage detected