I am using Next.js, Supabase & Strapi in a project i'm working on.
I have a button in the homepage called "Add a user". On clicking the button I'd like either of the 2 below scenarios to happen.
Scenario 1. Go to sign up page (if new user) / login page is registered user --> After login --> Go to page where user details are entered by end-user and then captured to store in DB --> Other actions.
Scenario 2. Go to page where user details are entered by end-user -> hold the data -> prompt user to login / register --> Save the previously entered data.
How can I achieve either of the above 2 scenarios. Please help! Looking for snippets or concept ideas.
I was able to implement the first scenario. I used query params in the Next.js Link component to perform following actions : Click on add a listing button -> Login / register -> After successful login -> Go to page where listing data is collected.