<?php 
namespace PortalPeople\oauth2\models;


class OauthUser implements \OAuth2\Storage\UserCredentialsInterface
{

   
    public function checkUserCredentials($username, $password)
    {
        $login = new \common\models\Loginform();
        $login->username = $username;
        $login->password = $password;
        $data = $login->validate();
        return $data;
        
    }

    public function getUserDetails($username)
    {
        $user = \common\models\User::findByUsername($username);
        if ($user) {
            return [
                'user_id' => $user->user_id,
                'username' => $user->username,
                // Add other user details if needed
            ];
        }
        return false;
    }
}