Quantcast
Channel: Login only if user is active using Laravel - Stack Overflow
Viewing all articles
Browse latest Browse all 25

Answer by Mohsen for Login only if user is active using Laravel

$
0
0

I check user is actived by overwrite sendLoginResponse function in LoginController

protected function sendLoginResponse(Request $request){    if($this->guard()->user()->active == 0){        $this->guard()->logout();        return redirect()->back()            ->withInput($request->only($this->username(), 'remember'))            ->withErrors(['active' => 'User in not activated.']);    }    $request->session()->regenerate();    $this->clearLoginAttempts($request);    return $this->authenticated($request, $this->guard()->user())            ?: redirect()->intended($this->redirectPath());}

Viewing all articles
Browse latest Browse all 25

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>