Options
All
  • Public
  • Public/Protected
  • All
Menu

Module auth/auth

Index

Functions

isUser

  • isUser(user: Express.User): user is User
  • A Type Guard to identify if a Passport user is a User

    Parameters

    • user: Express.User

      A passport JS user

    Returns user is User

    A boolean representing if the user is a User

Const requireAuth

  • requireAuth(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction): void
  • An express middleware which enforces authentication

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

      An express request

    • res: Response<any, Record<string, any>>

      An express response

    • next: NextFunction

      A function to call the next express middleware

    Returns void

Const setupPassport

  • setupPassport(app: Express): Promise<void>
  • Setup Passport authentication for the express application

    Parameters

    • app: Express

      An Express application

    Returns Promise<void>

Generated using TypeDoc