Skip to content

create: README.md, sync improvements #4

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

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# lambda-authorizer-client

Lambda authorizer which validates JWT signature and claims. Specific to client ordering flow.

Part of a group course project of a self service and kitchen management system for a fictional fast food restaurant.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ exports.handler = async (event) => {
jwtSettings.options
);

if (decoded.sub == null) {
console.log('Missing sub claim');
if (!decoded.sub || !Number(decoded.sub)) {
console.log('Missing or invalid sub claim');
return { isAuthorized: false };
}

return { isAuthorized: true };
} catch (error) {
console.log('Token validation failed', token);
console.log('Token verification failed', token);
return { isAuthorized: false };
}
};