Commit 59e7e4a2 authored by Franz Liedke's avatar Franz Liedke

Update authentication config file in testing application.

parent 41ff7af2
...@@ -4,78 +4,70 @@ return array( ...@@ -4,78 +4,70 @@ return array(
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Retrieve The Current User | Default Authentication Driver
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This closure is called by the Auth class' "user" method when trying to | Laravel uses a flexible driver-based system to handle authentication.
| retrieve a user by the ID that is stored in their session. If you find | You are free to register your own drivers using the Auth::extend
| the user, just return the user object, but make sure it has an "id" | method. Of course, a few great drivers are provided out of
| property. If you can't find the user, just return null. | box to handle basic authentication simply and easily.
| |
| Of course, a simple and elegant authentication solution has already | Drivers: 'fluent', 'eloquent'.
| been provided for you using the query builder and hashing engine.
| We love making your life as easy as possible.
| |
*/ */
'user' => function($id) 'driver' => 'fluent',
{
if (filter_var($id, FILTER_VALIDATE_INT) !== false)
{
return DB::table('users')->find($id);
}
},
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Authenticate User Credentials | Authentication Username
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This closure is called by the Auth::attempt() method when attempting to | Here you may specify the database column that should be considered the
| authenticate a user that is logging into your application. It's like a | "username" for your users. Typically, this will either be "username"
| super buff bouncer to your application. | or "email". Of course, you're free to change the value to anything.
|
| If the provided credentials are correct, simply return an object that
| represents the user being authenticated. As long as it has a property
| for the "id", any object will work. If the credentials are not valid,
| you don't meed to return anything.
| |
*/ */
'attempt' => function($username, $password) 'username' => 'username',
{
$user = DB::table('users')->where_username($username)->first(); /*
|--------------------------------------------------------------------------
| Authentication Password
|--------------------------------------------------------------------------
|
| Here you may specify the database column that should be considered the
| "password" for your users. Typically, this will be "password" but,
| again, you're free to change the value to anything you see fit.
|
*/
if ( ! is_null($user) and Hash::check($password, $user->password)) 'password' => 'password',
{
return $user;
}
},
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Logout The Current User | Authentication Model
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may do anything that needs to be done when a user logs out of | When using the "eloquent" authentication driver, you may specify the
| your application, such as call the logout method on a third-party API | model that should be considered the "User" model. This model will
| you are using for authentication or anything else you desire. | be used to authenticate and load the users of your application.
| |
*/ */
'logout' => function($user) {}, 'model' => 'User',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| "Remember Me" Cookie Name | Authentication Table
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify the cookie name that will be used for the cookie | When using the "fluent" authentication driver, the database table used
| that serves as the "remember me" token. Of course, a sensible default | to load users may be specified here. This table will be used in by
| has been set for you, so you probably don't need to change it. | the fluent query builder to authenticate and load your users.
| |
*/ */
'cookie' => 'laravel_remember', 'table' => 'users',
); );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment