Alternative way to initialize keycloak #30
Replies: 1 comment 2 replies
-
You are free to use another approach and to provide a PR. I'll then investigate your suggestion. This way of doing it is for me a working, performant and reliable way and it's proven in various projects in the last (5-6?) years. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello and thanks for your tutorials and project example,
I saw this and I am not convinced that this is a good way to initialize authentication in React.
keycloak-reactjs-demo/src/index.js
Line 8 in da4fe42
The way I expected this to work is to have a provider HOC that exposes the state in context, not to callback the entire render function.
Maybe we can come up with a UserServiceProvider so we can use the Provider/Consumer pattern instead of the current example.
I would make the higher order component pass down initialized and user, when the init callback resolves the initialized should be true and user should have the service methods/objects.
Beta Was this translation helpful? Give feedback.
All reactions