fix: OpenID Connect and Local route rendering

This commit is contained in:
Erik Ziegler committed 2021-07-08 10:29:41 +02:00
1 parent f5ecc753f7
commit 3a53479bb7
9 files changed
+50 -67

No files matched your search

@@ -88,6 +88,7 @@ export function UserAuthenticationProvider({ children, service }) {
*
* @returns void
*/
// TODO: should this be a useEffect or not?
useEffect(() => {
if (service) {
service.setServiceImplementation({
@@ -100,6 +101,19 @@ export function UserAuthenticationProvider({ children, service }) {
}
}, [getState, service, setUser, getUser, reset, set]);
// TODO: This may not be correct, but I think we need to set the implementation for the service
// immediately when this runs, since otherwise the authentication redirects will fail.
// (useEffect only runs after the child components - in this case, routing logic - has failed)
if (service) {
service.setServiceImplementation({
getState,
setUser,
getUser,
reset,
set,
});
}
const api = {
getState,
setUser,