-
Notifications
You must be signed in to change notification settings - Fork 0
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
JNG-5697 On module change when different user have valid key invalida… #389
base: develop
Are you sure you want to change the base?
JNG-5697 On module change when different user have valid key invalida… #389
Conversation
window.location.reload(); | ||
} | ||
} | ||
}, [useSearchParams, getUser]); |
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.
useSearchParams
is not used, should not be needed in the dependencies array.
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.
getUser
also never changes, so the dependency array should be empty I think.
clearSecurityStorage(); | ||
const { origin } = window.location; | ||
window.location.href = origin + '/' + applicationKey; | ||
window.location.href = origin + '/' + applicationKey + "?user=" + tokenUser ; |
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.
Since tokenUser
could be an email address, we might need to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent it to make sure special characters are encoded in the param. Not sure, we should check.
const tokenUser = profile?.preferred_username; | ||
if (tokenUser != null && tokenUser === forcedUser) { | ||
clearSecurityStorage(); | ||
window.location.reload(); |
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.
The ?user
search param should be removed before we reload I think since we won't need it any more.
…te it