access-token-parser.ts 551 B

1234567891011121314151617181920
  1. import type { Request, RequestHandler } from 'express';
  2. import type { IUserSerializedSecurely } from '../../models/serializers';
  3. import type { Scope } from '../scope';
  4. import type { IUserHasId } from '../user';
  5. export interface AccessTokenParserReq extends Request {
  6. user?: IUserSerializedSecurely<IUserHasId>;
  7. query: Request['query'] & {
  8. access_token?: string;
  9. };
  10. body: Request['body'] & {
  11. access_token?: string;
  12. };
  13. }
  14. export type AccessTokenParser = (
  15. scopes?: Scope[],
  16. opts?: { acceptLegacy: boolean },
  17. ) => RequestHandler;