Skip to content

Commit

Permalink
export another type for credentialsRequired: false / ExpressJwtReques…
Browse files Browse the repository at this point in the history
…tUnrequired
  • Loading branch information
jfromaniello committed Apr 27, 2022
1 parent 6d767c4 commit 1bdb6f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ type Params = {
export { UnauthorizedError } from './errors/UnauthorizedError';

export type ExpressJwtRequest<T = jwt.JwtPayload> =
express.Request & { auth?: T }
express.Request & { auth: T }

export type ExpressJwtRequestUnrequired<T = jwt.JwtPayload> =
express.Request & { auth?: T }

export const expressjwt = (options: Params) => {
if (!options?.secret) throw new RangeError('express-jwt: `secret` is a required option');
Expand Down

0 comments on commit 1bdb6f3

Please sign in to comment.