Redirect after authentication - Jetstream+Laravel+Inertia
Hey Everyone,
I have a problem redirecting users to a particular screen after a user registers on the Jetstream app. So here is the flow that I expect which doesn't work currently.
After the user registers,
I want the user to be directed to /problems
There is a set of DB entries that I need to do, in order for the user to operate the app normally
So I redirect them through the RouteServiceProvider with the following setting
public const HOME = '/problems';
When the user hits the route, I have the code that makes the necessary DB entries
Here is the problem with this(when I set HOME to /probelms), when I register a user the current_team_id in the users table is blank. But I rely on it for my logic to work.
When I set the HOME to just "/", the current_team_id is ok, but How do I get the user to go to /problems and make those DB entries?
I get the following error when I set it to /problems
Too many redirects
Does anyone have any clues? I am using Jetstream+Inertia.
@madprabh you need to check your logic. What I think is happened:
You registered and redirected to problems
You have some checks on problemsroute (it can be middleware, or logic in controller). For example, you check that user has current_team_id and redirect to login if it's empty
You redirected to HOME route from login, because you are logged in
repeat step 2
repeat step 3
...
Check what can redirect user from /problems to login or register