Skip to content

Commit

Permalink
Update validate
Browse files Browse the repository at this point in the history
  • Loading branch information
marklise committed Oct 7, 2024
1 parent 2f8df94 commit 26a6e68
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion handlers/authorizer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ async function batchQueryWrapper(tableName, key, values) {
return results;
}

function validateToken(token) {
async function validateToken(token) {
try {
const payload = await verifier.verify(
"eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string
);
console.log("Token is valid. Payload:", payload);
} catch {
console.log("Token not valid!");
}

console.log("validateToken", token);
const decodedToken = jwt.decode(token, { complete: true });
console.log(decodedToken);
Expand Down

0 comments on commit 26a6e68

Please sign in to comment.