-
Notifications
You must be signed in to change notification settings - Fork 5
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
Mvj 453 hds login #521
Mvj 453 hds login #521
Conversation
add new silent_renew.html from HDS docs remove unneeded tests, add a few semiuseful reducer/action tests
} = this.props; | ||
const CallbackPage = (props: Props) => { | ||
const onSuccess = (user: User) => { | ||
const { history } = props; | ||
history.push(getRedirectUrlFromSessionStorage() || getRouteById(Routes.LEASES)); |
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.
Check if the url startswith /callback
and don't store that into session storage. Could happen if auth callback from oidc server fails.
const { getStoredApiTokens } = useApiTokens(); | ||
|
||
const setLoggedInIfApiTokenExists = useCallback(() => { | ||
const [_error, apiToken] = getStoredApiTokens(); |
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.
Consider logging possible error
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.
Normally _error is null, so if we want to log possible errors from getStoreApiTokens, it could be logged inside an if (_error) {}
block. Might help debugging, but not necessary.
const { getStoredApiTokens } = useApiTokens(); | ||
|
||
const setLoggedInIfApiTokenExists = useCallback(() => { | ||
const [_error, apiToken] = getStoredApiTokens(); |
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.
Normally _error is null, so if we want to log possible errors from getStoreApiTokens, it could be logged inside an if (_error) {}
block. Might help debugging, but not necessary.
apiTokensRemovedSignal is also sent during token update process, not just on removal
oidcRenewing was not called, and nothing was returned from the callback
I would like feedback on:
Also if you see something obvious that triggers rerenders that would be nice. Not really ideal that e.g.
USER_FOUND
actions trigger multiple times. Is there a better way to define theuseEffect
's (One cause is probablymapStatesToPros
onApp
, could see if something can be fixed there.Check the docs here: https://hds.hel.fi/components/login/