Force login failed

Force login failed

siemike -
1 year ago

Hi,
I'm going to implement 2FA for my website, basically I will send SMS code to user after login. I've change the LoginFormHandler to redirect to SMS authentication, its works great but when the OTP code succeed I use $authenticator->login($user, true); , redirect to admin panel and it failed. I've tried use both UserAuthenticator and auth()->login($user) but neither of them are succeeded. Anybody in this forum has a same problem?

piterden -
1 year ago

siemike -
1 year ago

Yes, I've changed LoginFormHandler to redirecting to controller that handle SMS authentication. The problem is I can't do force login. I've tested using $authenticator->login($user, true) and auth()->login($user) but failed

ryanthompson -
1 year ago

siemike -
1 year ago

ryanthompson -
1 year ago

Have you tried native Laravel methods? It might have to do with the timing / lifecycle of the response. I know at one point I had to force a refresh because the session was just sitting there but not being attached to the response or something like that.. But.. a form handler should be fine cause it DOES return the response.. so the session would get pushed in after forcing auth..

Can you share your code for the builder? I assume you've verified that it's being overridden properly :-P