Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud-Lyard committed Aug 12, 2024
2 parents ae1c25d + 189c522 commit 2dcd83f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions client/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const locales = ['en', 'fr'];
async function importKey() {
const alg = 'RS256';
const spki = process.env.JWT_PUBLIC_KEY!;
console.log('spki', spki);
const publicKey = await jose.importSPKI(spki, alg);
console.log('publicKey', publicKey);
return publicKey;
}

Expand Down Expand Up @@ -53,7 +51,6 @@ async function i18nMiddleware(request: NextRequest) {
}

export async function middleware(request: NextRequest) {
console.log(request.nextUrl.pathname);
if (
request.nextUrl.pathname.startsWith('/fr/user') ||
request.nextUrl.pathname.startsWith('/en/user') ||
Expand Down
3 changes: 0 additions & 3 deletions server/src/utils/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import jwt, { SignOptions } from 'jsonwebtoken';

export const signJwt = (payload: Object, options: SignOptions) => {
const privateKey = process.env.JWT_ACCESS_TOKEN_PRIVATE_KEY;
console.log(privateKey);
return jwt.sign(payload, privateKey, {
...(options && options),
algorithm: 'RS256',
Expand All @@ -12,9 +11,7 @@ export const signJwt = (payload: Object, options: SignOptions) => {
export const verifyJwt = <T>(token: string): T | null => {
try {
const publicKey = process.env.JWT_ACCESS_TOKEN_PUBLIC_KEY;
console.log('publickey', publicKey);
const decoded = jwt.verify(token, publicKey) as T;
console.log('decoded', decoded);

return decoded;
} catch (error) {
Expand Down

0 comments on commit 2dcd83f

Please sign in to comment.