Files
spa-api/application/config/auth.php

44 lines
1.2 KiB
PHP
Raw Normal View History

2011-06-08 23:45:08 -05:00
<?php
return array(
/*
|--------------------------------------------------------------------------
2011-07-11 12:41:50 -07:00
| Retrieve Users By ID
2011-06-08 23:45:08 -05:00
|--------------------------------------------------------------------------
|
2011-07-11 12:45:04 -07:00
| This method is called by the Auth::user() method when attempting to
| retrieve a user by their user ID, such as when retrieving a user by the
| user ID stored in the session.
2011-06-08 23:45:08 -05:00
|
2011-07-11 12:41:50 -07:00
| You are free to change this method for your application however you wish.
2011-06-08 23:45:08 -05:00
|
*/
2011-07-11 12:41:50 -07:00
'by_id' => function($id)
{
return User::find($id);
},
2011-06-08 23:45:08 -05:00
/*
|--------------------------------------------------------------------------
2011-07-11 12:41:50 -07:00
| Retrieve Users By Username
2011-06-08 23:45:08 -05:00
|--------------------------------------------------------------------------
|
2011-07-11 12:45:04 -07:00
| This method is called by the Auth::check() method when attempting to
| retrieve a user by their username, such as when checking credentials
| received from a login form.
2011-07-11 12:41:50 -07:00
|
2011-07-11 12:45:04 -07:00
| You are free to change this method for your application however you wish.
|
| Note: This method must return an object that has "id" and "password"
| properties. The type of object returned does not matter.
2011-06-08 23:45:08 -05:00
|
*/
2011-07-11 12:41:50 -07:00
'by_username' => function($username)
{
return User::where_email($username)->first();
2011-07-11 12:41:50 -07:00
},
2011-06-08 23:45:08 -05:00
);