This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/app/Http/Controllers/Auth/AuthController.php

30 lines
617 B
PHP
Executable File

<?php namespace App\Http\Controllers\Auth;
use Illuminate\Routing\Controller;
use Auth;
class AuthController extends Controller {
/**
* Handle an authentication attempt.
*
* @return Response
*/
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password]))
{
return redirect()->intended('/admin');
}
return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?',]);
}
public function logout()
{
Auth::logout();
}
}