Skip to content

Satyam #1162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Satyam #1162

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Week-3 02-jwt assignment completed
  • Loading branch information
satyamlal committed Jan 15, 2025
commit 9ac7f9512cf06fd3e10906dfcbef4d4a7a00954a
3 changes: 2 additions & 1 deletion week-3/02-jwt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function verifyJwt(token) {
try {
jwt.verify(token, jwtPassword);
return true;
} catch (e) {
} catch (err) {
return false;
}
}
Expand All @@ -64,6 +64,7 @@ function decodeJwt(token) {
// Your code here
return !!jwt.decode(token);
}
//Another way is to use arrow function along with a ternary operator
//const decoded = (token) => jwt.decode(token) ? true : false;

module.exports = {
Expand Down