#Redirect to app panel instead of admin panel
5 messages · Page 1 of 1 (latest)
How are you inviting users?
Like this one: https://www.youtube.com/watch?v=YpK16Z6Hr14&t=85s
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());
}
Shouldn't there be a redirect anywhere? I don't think auth()->login() will redirect you