-
Notifications
You must be signed in to change notification settings - Fork 168
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
Feat/add jwt to authjs #215
Conversation
Risk Level 2 - /home/runner/work/code-review-gpt/code-review-gpt/services/web-app/src/app/profile/page.tsx The changes in the profile page have a moderate risk to the code base. The added code retrieves the user data from the server using the 'getUser' endpoint and displays it on the page. No potential bugs or readability issues were found. However, it would be better to handle the case when the user data cannot be retrieved separately from the case when the user is not logged in. Risk Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/services/web-app/src/lib/hooks/useAxios.tsx
Example code snippet for readability improvement: const session: Session | null = getSession(); Example code snippet for separating concerns: const setAuthorizationHeader = (config: AxiosRequestConfig, session: Session) => {
config.headers.Authorization = session.token;
return config;
};
axiosInstance.interceptors.request.clear();
axiosInstance.interceptors.request.use((config) => setAuthorizationHeader(config, session)); Risk Level 3 - /home/runner/work/code-review-gpt/code-review-gpt/services/core/functions/update-user/index.ts The changes in the update-user function have a moderate risk to the code base. The added code retrieves the 'userId' from the request body and uses it to update the user in the UserEntity. No potential bugs or readability issues were found. However, it would be better to handle the case when 'apiKey' or 'userId' is not provided separately from the error when updating the user. 🔍🔧👍 Powered by Code Review GPT |
Test results summary:✅ [PASS] - Test case: Bad variable name SUMMARY: ✅ PASS: 2 - Tests Powered by Code Review GPT |
fcb5151
to
7bebd19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also please check the Update-User and make sure that that also has the email changed to userId.
|
||
if (email === undefined) { | ||
if (userId === undefined) { | ||
return formatResponse("Please provide the email of the user you wish to get.", 400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return formatResponse("Please provide the email of the user you wish to get.", 400) | |
return formatResponse("Please provide the userId of the user you wish to get.", 400) |
autoDeleteObjects: !isProduction(), | ||
// autoDeleteObjects: !isProduction(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattzcarey Seb and I chatted about this. Adding this autoDeleteObjects thing is a bit broken, and it doesn't allow you to tear down your stack (you will see a couple of stacks already have DeleteFailed). So we have both commented this out for now. Might be a good things to investigate!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
console.log("Failed to getUser"); | ||
console.log("Failed to getUser, error -> ", err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
export const BASE_URL = "https://mylf3hxjs8.execute-api.eu-west-2.amazonaws.com/prod"; | ||
export const BASE_URL = "https://2dw4kjr0a2.execute-api.eu-west-2.amazonaws.com/prod"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to chat about how to better do this. Not now's problem, but would be nice if this could be gotten from aws or something!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use the staging URL here in future. That is deployed.
axiosInstance.interceptors.request.clear(); | ||
axiosInstance.interceptors.request.use( | ||
(config) => { | ||
config.headers.Authorization = (session as Session).token; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it
No description provided.