I'm used to working on laravel 5.4 and above, i just got this project with a problem in authentification that is rather weird. Locally, the authentification works just fine but when i try to log using the project on prod i always get redirected to login page. this is the login function:
public function loginadmin()
{
$pseudo = Input::get('pseudo');
$pass = Input::get('pass');
$user = Admin::where('pseudo',$pseudo)->where('pass',$pass)->get()->first();
if($user){
Auth::admin()->loginUsingId( $user->id );
return Redirect::back();
}
else{
Session::flash('errorAuth', "ok");
return Redirect::back();
}
}
this is the routes.php
/* Connexion */
Route::get('admin-igd', function(){
if( !Auth::admin()->get())
return View::make('admin.login');
return Redirect::to('admin-igd/slider');
});
and this is the filters.php:
Route::filter('loginadmin', function($route, $request)
{
if ( !Auth::admin()->get()) {
return Redirect::to('admin-igd');
}
});