I have a need to retain data about a page when a user is taken to the auth0 login page so when they are authenticated, info about the page they came from is passed or saved so I can continue to process the information. As mentioned elsewhere here, localStorage, cookies, and sessions are not feasible, especially after email verification. We are using SDK/PHP for web application.
I used the acr_values property in my application to save the original URL (window.location.origin) and access it in an Action. In the Action, you could save it to the user’s metadata or set it as a custom claim.
Thank you for your response. Unfortunately, that really did not help as we are using PHP SDK to authenticate. Is there a way to pass in the referrer page via the login? How would we go about doing that?
I appreciate your patience while we were out for the holidays!
I did more research into this, and apart from the solution I shared above, there is no other way to access/pass through the referrer page via the login. I checked the PHP documentation and do not see an acr_values or other similar parameter to pass in.
Thank you for taking the time to research. I do have another question about this. We have a regular web application and using this approach for authentication. I am wondering if we can use the SPA just for authentication? If we did, could we then use the javascript acr_values? I think this would help address the issue when folks verify their email via mobile when they sign up (on laptop browser). Our current process causes us to lose some data that we’d like to save once they verify. Does this make sense?
You are wanting to switch from a regular web app to a SPA or use both together? Just trying to clarify. If you do use a SPA where the SDK supports acr_values, then yes this would work.
I think I need to understand what SPA really means. I ask because MOST websites are multiple pages. We have about 4 or 5 pages in our website. We’d like to have them sign up or log in and upon completion, redirect to a different page. The problem with using the regular web application is that we can’t save info when going to/from auth0 since we are actually leaving the website to login/signup via auth0. We do use localstorage but that is not optimal when we require email verification, especially when users might use their mobile device to verify and a browser on their laptop/desktop. Information would be lost. But if we had a means to pass info to auth0 to store (like a metadata array, or similar), then we could extract that and save the info into our tables. So I was wondering if using SPA would be a feasible alternative since it provides a place to store info.