Skip to content
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

fix: Remove getUser in callback handler #461

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

ed-sparkes
Copy link
Contributor

@ed-sparkes ed-sparkes commented Feb 3, 2021

Update to the signincallback flow to make state returned from oidc-client available to the onSignIn event

fixes #447

…o that state is accessible in onSignIn callback
@update-docs
Copy link

update-docs bot commented Feb 3, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update some of our documentation based on your changes. You can run yarn generate-docs to generate some!

@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #461 (d3772ba) into master (cd34137) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #461      +/-   ##
==========================================
- Coverage   96.22%   96.15%   -0.08%     
==========================================
  Files           1        1              
  Lines          53       52       -1     
  Branches       11       11              
==========================================
- Hits           51       50       -1     
  Misses          2        2              
Impacted Files Coverage Δ
src/AuthContext.tsx 96.15% <100.00%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd34137...348413a. Read the comment docs.

@ed-sparkes ed-sparkes changed the title use user from callback with state to store in context after sign in s… fix: Make state available after signincallback to onSignIn event Feb 3, 2021
@ed-sparkes
Copy link
Contributor Author

not sure what to do about the semantic pull request i renamed the PR to be prefix with fix: but not sure how to "Squash and Merge"

@@ -85,8 +85,7 @@ export const AuthProvider: FC<AuthProviderProps> = ({
* Check if the user is returning back from OIDC.
*/
if (hasCodeInUrl(location)) {
await userManager.signinCallback();
const user = await userManager.getUser();
const user = await userManager.signinCallback();
Copy link
Member

Choose a reason for hiding this comment

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

Okey, so signinCallback returns the same as getUser?

@simenandre
Copy link
Member

not sure what to do about the semantic pull request i renamed the PR to be prefix with fix: but not sure how to "Squash and Merge"

Don't worry about that, I can fix that :)

Copy link
Member

@simenandre simenandre left a comment

Choose a reason for hiding this comment

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

Thank you so much for contributing to this project!

@simenandre simenandre changed the title fix: Make state available after signincallback to onSignIn event fix: Remove getUser in callback handler Feb 3, 2021
@simenandre simenandre merged commit 7abb83d into bjerkio:master Feb 3, 2021
@ed-sparkes
Copy link
Contributor Author

sweet, its merged :) how does this get upversioned and released to npm ?

github-actions bot pushed a commit that referenced this pull request Feb 3, 2021
## [1.1.6](v1.1.5...v1.1.6) (2021-02-03)

### Bug Fixes

* Remove `getUser` in callback handler ([#461](#461)) ([7abb83d](7abb83d)), closes [#447](#447)
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2021

🎉 This PR is included in version 1.1.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@simenandre
Copy link
Member

sweet, its merged :) how does this get upversioned and released to npm ?

Already done 👇

🎉 This PR is included in version 1.1.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Accessing state after signin
2 participants