Skip to content

Commit

Permalink
use the already JWT SERCRET in the env
Browse files Browse the repository at this point in the history
  • Loading branch information
siinghd committed Feb 26, 2024
1 parent 89230ce commit 2bdb2f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ BOT_TOKEN = "123"
GUILD_ID = "123"
LOCAL_CMS_PROVIDER = true
CACHE_EXPIRE_S = 10
JWT_SECRET_TOKEN="JWT_SECRET_TOKEN"

7 changes: 7 additions & 0 deletions src/app/admin/user/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

const page = () => {
return <div>page</div>;
};

export default page;
2 changes: 1 addition & 1 deletion src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CredentialsProvider from 'next-auth/providers/credentials';
import { SignJWT, importJWK } from 'jose';

const generateJWT = async (payload: any) => {
const secret = process.env.JWT_SECRET_TOKEN || 'secret';
const secret = process.env.JWT_SECRET || 'secret';

const jwk = await importJWK({ k: secret, alg: 'HS256', kty: 'oct' });

Expand Down

0 comments on commit 2bdb2f1

Please sign in to comment.