Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Retrieve a user by the given credentials.
- *
- * @param array $credentials
- * @return \Illuminate\Contracts\Auth\Authenticatable|null
- *
- ** this one sorta dupulicates validate but it works.....
- */
- public function retrieveByCredentials(array $credentials) {
- $api = new IgnitionapiController();
- $data = [ "function" => "login_user", "username" => $credentials['username'], "password" => $credentials['password'], "ordertype"=> config('services.ignitionapi.ignition_api_vas_type')];
- $res = $api->process_api_response($api->process_api($data));
- if($res['success'] && isset($res['success'])) {
- return new ignitionUser();//tried adding stuff to object here didn't work
- }
- return null;
- }
- /**
- * Validate a user against the given credentials.
- *
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param array $credentials
- * @return bool
- */
- public function validateCredentials(\Illuminate\Contracts\Auth\Authenticatable $user, array $credentials) {
- $api = new IgnitionapiController();
- $data = [ "function" => "login_user", "username" => $credentials['username'], "password" => $credentials['password'], "ordertype"=> config('services.ignitionapi.ignition_api_vas_type')];
- $res = $api->process_api_response($api->process_api($data));
- if($res['success'] && isset($res['success'])) {
- $user->name = $credentials['username'];
- $user->email = (isset($credentials['email']) ? $credentials['email'] : '' );
- return true;
- }else{
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement