Skip to content

Conversation

billsedison
Copy link
Collaborator

@billsedison billsedison commented Sep 14, 2025

Root cause: The tc-core-library-js (used for JWT validation) was adding the decoded JWT payload fields directly, including userId: 40158767 as a number, while the database schema requires all user IDs to be strings.

// Create a mock request object with the authorization header
const mockReq = {
// Create a request object with the authorization header
const req = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming req to something more descriptive, such as authRequest, to clarify its purpose and distinguish it from other potential request objects.

};

const mockRes = {};
const res = {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming the variable res to something more descriptive to clarify its purpose and usage within the code.


// Call the tc-core-library-js authenticator
this.jwtAuthenticator(mockReq, mockRes, next);
this.jwtAuthenticator(req, res, next);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from mockReq and mockRes to req and res suggests that the actual request and response objects are now being used. Ensure that req and res are correctly initialized and contain the expected properties before passing them to jwtAuthenticator. This change might affect how the authenticator processes the request and response, so verify that it behaves as intended with real objects.

@jmgasper jmgasper merged commit 11c4669 into develop Sep 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants