(req: IncomingMessage)
| 28 | } |
| 29 | |
| 30 | authenticate(req: IncomingMessage): AuthUser | null { |
| 31 | if (!this.token) { |
| 32 | return { id: "default", isAdmin: true }; |
| 33 | } |
| 34 | if (this.extractToken(req) === this.token) { |
| 35 | return { |
| 36 | id: "default", |
| 37 | isAdmin: this.adminUsers.size === 0 || this.adminUsers.has("default"), |
| 38 | }; |
| 39 | } |
| 40 | return null; |
| 41 | } |
| 42 | |
| 43 | setupRoutes(_app: Application): void { |
| 44 | // Token auth needs no login/callback/logout routes. |
no test coverage detected