diff --git a/ReadMe.md b/ReadMe.md index 0c06591..52ddcc6 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -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, diff --git a/package.json b/package.json index 5010ffb..11a301b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-ssr-middleware", - "version": "0.6.0", + "version": "0.6.1", "license": "LGPL-3.0-or-later", "author": "shiy2008@gmail.com", "description": "Koa-like middlewares for Next.js Server Side Rendering", diff --git a/source/middleware.ts b/source/middleware.ts index c1af0f8..6b03f4d 100644 --- a/source/middleware.ts +++ b/source/middleware.ts @@ -58,7 +58,7 @@ export interface JWTProps { export function jwtVerifier( tokenKey = 'token', - secretKey = 'JWT_TOKEN', + secretKey = 'JWT_SECRET', options: VerifyOptions = {} ): Middleware { return async ({ req: { url, cookies } }, next) => {