I have a booking platform and I want to know how I can check if the user is signed in or not at the booking stage, when choosing the number of days,etc .
If the user is not, then I want to show the sign in or sign up popups or direct them to the signup page.
Then after the user creates an account or login (depending on the case) , they should be redirected back to the booking page.
For this, usually you want to check if there’s a user session or an auth token when they get to the booking page. If not, show the sign-in/sign-up popup or redirect them to the signup page.
The conditional is on the action of show popup. The way I usually do it is a single popup with two modes, either login or signup, and when I show popup I set mode conditionally.