Skip to content

Commit

Permalink
[fix] Environment Variable name of JWT secret
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Nov 6, 2023
1 parent fbbc90b commit e518906
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { User, UserModel } from '../../model/User';
type UserDetailPageProps = User & JWTProps & RouterProps;

export const getServerSideProps = compose<{ id: string }, UserDetailPageProps>(
jwtVerifier(),
jwtVerifier(), // set `JWT_SECRET` in `.env.local` first
cache(),
errorLogger,
router,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-ssr-middleware",
"version": "0.6.0",
"version": "0.6.1",
"license": "LGPL-3.0-or-later",
"author": "[email protected]",
"description": "Koa-like middlewares for Next.js Server Side Rendering",
Expand Down
2 changes: 1 addition & 1 deletion source/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface JWTProps<T extends DataObject = {}> {

export function jwtVerifier<I extends DataObject, O extends DataObject = {}>(
tokenKey = 'token',
secretKey = 'JWT_TOKEN',
secretKey = 'JWT_SECRET',
options: VerifyOptions = {}
): Middleware<I, O & JWTProps> {
return async ({ req: { url, cookies } }, next) => {
Expand Down

0 comments on commit e518906

Please sign in to comment.