Hi there. I’m working with a react front end application using the Universal Login. I have a use case that requires me to show some messaging on the login/signup form depending on the guarded route that was chosen. So far all attempts at getting the data into the liquid template have failed. Should I avoid liquid templates all together? Do i need to revert to embedded login to get the interaction i require?
Please ignore the obvious error in the code snippets. I did replace the variables in the liquid template to match the code examples above and got the “Sample param not available” text
There are a few things to keep into consideration with what you are trying to build, first let me point out, since you read the article on “Building Beautiful Pages” that the command mentioned on the article is outdated, and though still valid, there’s a new recommended command:
auth0 universal-login customize
This provides a new interface, which makes it much easier to fully customize your login experience. You probably already found this out, as the CLI will advice this new command when using the previous one.
On regards to your code, I wouldn’t recommend to alter appState when calling withAuthenticationRequired, instead pass your parameters using authorizationParams as follows:
Thank you so much, Juan. I tested it out and it worked as expected. Thank you for pointing out the use of the authorizationParams over appState.
I went further to test to see if adding the authorizationParams in the Route component would overwrite the ones added on the Auth0Provider component. It does not, I was able to access params from both as long as they were prefixed with the ext- so that’s a huge plus. Thanks again!