| 236 | } |
| 237 | |
| 238 | async verifyAccessToken(token: string): Promise<AuthInfo> { |
| 239 | const record = this.oauthStore.getAccessToken(hashToken(token)); |
| 240 | if (!record || record.expiresAt < Math.floor(Date.now() / 1000)) { |
| 241 | throw new InvalidTokenError("Invalid or expired access token"); |
| 242 | } |
| 243 | |
| 244 | return { |
| 245 | token, |
| 246 | clientId: record.clientId, |
| 247 | scopes: record.scopes, |
| 248 | expiresAt: record.expiresAt, |
| 249 | resource: record.resource ? new URL(record.resource) : undefined, |
| 250 | }; |
| 251 | } |
| 252 | |
| 253 | async revokeToken(_client: OAuthClientInformationFull, request: OAuthTokenRevocationRequest): Promise<void> { |
| 254 | const hashed = hashToken(request.token); |