Skip to content

Commit

Permalink
fix(middleware/jwt): fix incorrect assumption in jwt impl (#2775)
Browse files Browse the repository at this point in the history
* breaking change: fix incorrect assumption in jwt impl

* denofiy
  • Loading branch information
boehs authored May 23, 2024
1 parent d774711 commit cac22e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno_dist/middleware/jwt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const jwt = (options: {
cookie?: string
alg?: SignatureAlgorithm
}): MiddlewareHandler => {
if (!options) {
if (!options || !options.secret) {
throw new Error('JWT auth middleware requires options for "secret')
}

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/jwt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const jwt = (options: {
cookie?: string
alg?: SignatureAlgorithm
}): MiddlewareHandler => {
if (!options) {
if (!options || !options.secret) {
throw new Error('JWT auth middleware requires options for "secret')
}

Expand Down

0 comments on commit cac22e4

Please sign in to comment.