You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.4 KiB
PHP

<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\Libs\EncryptQuery;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
use EncryptQuery;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/cms';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
parent::__construct();
}
protected function authenticated(Request $request, $user)
{
$isDebug = config('app.debug', 'false');
if($isDebug && $user->type == 'Admin') {
// 자동인증
$request->session()->put('super_verified', true);
}
}
protected function loggedOut(Request $request)
{
return redirect(route('cms.login'));
}
}