Skip to content

Commit

Permalink
jwt verify update
Browse files Browse the repository at this point in the history
auth0/node-jsonwebtoken#208 (comment)
자바와 nodejs의 jwt토큰 호환성 에러해결
  • Loading branch information
lcc3108 committed Dec 12, 2019
1 parent e995e4e commit 5b2dd03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/graphql/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const awsServer = new ApolloServer({
const token = event.headers.authorization.substr(7);

try {
const user = jwt.verify(token, Buffer.from(process.env.JWT_SECRET).toString("base64"));
const user = jwt.verify(token, process.env.JWT_SECRET);
return { user };
} catch {
return { user: undefined };
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/graphql/gcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const gcpServer = new ApolloServer({
const token = req.headers.authorization.substr(7);
console.log("token", token);
try {
const user = jwt.verify(token, Buffer.from(process.env.JWT_SECRET).toString("base64"), (err, payload) => {
const user = jwt.verify(token, process.env.JWT_SECRET, (err, payload) => {
console.log("err", err);
console.log("payload", payload);
});
Expand Down

0 comments on commit 5b2dd03

Please sign in to comment.