Hi. I tried a lot, but nothing works. So I ask, even it is maybe a simple thing to solve. I use fortify and want to redirect the user, after he change his password. This also works, but i also want to send an info with the redirect like this:
return redirect('login')->with('hello','world');
But it is not working. Does anybody had this problem or can help?
Ok.. just wrote the post and now think about... could it be that in jetstream the livewire component does not have the web middleware and so dont support sessions? Just an idea and i will check it next.
thx @hasnainali9 and @webrobert for your ideas. I tried both. But i still dont get the values. Maybe Im I wrong how i want to access the vars from session? I do this on my login page:
in App\Actions\Fortify\UpdateUserPassword. If i do this in another route the variable will be shown on my login page. But not if I put it in the UpdateUserPasswort... But the redirect works. But not the session...
Could it be that it has something to do, that a user is logged out from laravel, when he chages his password?
@Pixelairport, hmmm, I think so. [if] you are regenerating or destroying the session. But that doesn't feel right. Show some code here. of what you are doing.
@webrobert ok thx. then i think it is done by fortify. maybe i have to do my own controller/logic ... or maybe i just use for this special task a parameter in the url and if the parameter is set the info will be displayed ... not a good solution but an easy one for now.
But it is also not working. After i change password i will be redirected and the url is shown as intended when I output the session but not shown in the url in the browser.
I now will check in session for intended url and if the action is set as update_user_password... it is not a good solution but it is something that could word for now. I would be glad if somebody has a better idea.
It works... I have to logout the user on my own before redirect. Otherwise i do the redirect and (i think a middleware) will do it after the redirect and destroy session. I hope this answer is right... but the code works. I have this in my fortify action.