-
Notifications
You must be signed in to change notification settings - Fork 10
[EAM-1675] Exchange token implementation #206
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
base: master
Are you sure you want to change the base?
Conversation
src/AuthWrapper.js
Outdated
|
|
||
| const handleTokens = (key, freshTokens) => { | ||
| tokens[key] = freshTokens; | ||
| console.log(tokens) |
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.
console.log
src/AuthWrapper.js
Outdated
| setTimeout(() => exchangeToken({ sourceClient, targetClient }), (response.data.expires_in - 20) * 1000); | ||
| return response.data; | ||
| } catch (_) { | ||
| console.log(_) |
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.
console.log. Also, need better error handling.
src/index.js
Outdated
| const getClientID = ({url}) => { | ||
| if (url?.startsWith(process.env.REACT_APP_EAM_SERVICES_URL)) { | ||
| return process.env.REACT_APP_KEYCLOAK_EAM_SERVICES_CLIENTID; | ||
| } else return process.env.REACT_APP_KEYCLOAK_CLIENTID; | ||
| }; | ||
|
|
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.
There should be a better, more generic way to get the client id instead of a binary check
Credits to Lulian.