Skip to content

Commit 0de3e42

Browse files
authored
create: README.md, sync improvements (#4)
2 parents 3c5fd66 + 340ce07 commit 0de3e42

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# lambda-authorizer-client
2+
3+
Lambda authorizer which validates JWT signature and claims. Specific to client ordering flow.
4+
5+
Part of a group course project of a self service and kitchen management system for a fictional fast food restaurant.

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ exports.handler = async (event) => {
2929
jwtSettings.options
3030
);
3131

32-
if (decoded.sub == null) {
33-
console.log('Missing sub claim');
32+
if (!decoded.sub || !Number(decoded.sub)) {
33+
console.log('Missing or invalid sub claim');
3434
return { isAuthorized: false };
3535
}
3636

3737
return { isAuthorized: true };
3838
} catch (error) {
39-
console.log('Token validation failed', token);
39+
console.log('Token verification failed', token);
4040
return { isAuthorized: false };
4141
}
4242
};

0 commit comments

Comments
 (0)