I am building an application based on your boilerplate. Currently, I am facing an issue and I would appreciate if you could give me some insight on how could I approach it.
I need to know how could I pass down to condition in withAuthorization.js the user that I get from Firestore and not the auth user so I can authorize it based on other fields that are not available in the auth user.
I made these changes to the component so I can have a general UserContext instead of an AuthUserContext. Basically, after getting the authUser, I look for the Firestore user data and then I merge the objects. Doing so, I can't rely anymore on onAuthStateChanged hook in withAuthorization file. The problem is that my users are redirected to the sign in page until the UserContext is filled (with auth user id and Firestore user data) and then they get redirected to the home component instead of the page they requested. I would like to avoid that trip and make the users land to the route they type in.
Hello,
I am building an application based on your boilerplate. Currently, I am facing an issue and I would appreciate if you could give me some insight on how could I approach it.
I need to know how could I pass down to
condition
inwithAuthorization.js
the user that I get from Firestore and not the auth user so I can authorize it based on other fields that are not available in the auth user.I made these changes to the component so I can have a general
UserContext
instead of anAuthUserContext
. Basically, after getting theauthUser
, I look for the Firestore user data and then I merge the objects. Doing so, I can't rely anymore ononAuthStateChanged
hook in withAuthorization file. The problem is that my users are redirected to the sign in page until the UserContext is filled (with auth user id and Firestore user data) and then they get redirected to the home component instead of the page they requested. I would like to avoid that trip and make the users land to the route they type in.Any recommendation would be appreciated, thank you.