Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

madprabh's avatar

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,

  1. I want the user to be directed to /problems
  2. There is a set of DB entries that I need to do, in order for the user to operate the app normally
  3. So I redirect them through the RouteServiceProvider with the following setting
public const HOME = '/problems';
  1. 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.

0 likes
1 reply
SilenceBringer's avatar

@madprabh you need to check your logic. What I think is happened:

  1. You registered and redirected to problems
  2. 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
  3. You redirected to HOME route from login, because you are logged in
  4. repeat step 2
  5. repeat step 3 ...

Check what can redirect user from /problems to login or register

Please or to participate in this conversation.