#Redirect to app panel instead of admin panel

5 messages · Page 1 of 1 (latest)

exotic hazel
#

I have an admin panel and an app panel. The default() is added on the admin panel.
Each time I try to login a user (after invitation email) using auth()->login($user); it would redirect to the admin panel.

Is there a way I can 'force' to go to the app panel?

exotic hazel
#

In fact, when the invite user action I create an invitation entry in a table. Then the invited user clicks on the link in the mail and the following is executed

public function create(): void
{

    $this->invitationModel = Invitation::find($this->invitation);

    $user = User::create([
        'name' => $this->form->getState()['name'],
        'email' => $this->invitationModel->email,
        'password' =>Hash::make($this->form->getState()['password']),
    ]);

    $user->organizations()->attach($this->invitationModel->organization_id);

    auth()->login($user);  //this one goes to admin panel because it's default() but I need it to go to app (user) panel

   $this->redirect(Dashboard::getUrl());
}
light crater
#

Shouldn't there be a redirect anywhere? I don't think auth()->login() will redirect you