mirror of
https://github.com/elyby/oauth2-server.git
synced 2026-11-23 16:03:23 +05:30
Updated password grant example
This commit is contained in:
1 parent
e7e4892408
commit
bb17abfe26
2 files changed
+39
-20
No files matched your search
@@ -1,22 +1,25 @@
|
||||
<?php
|
||||
namespace OAuth2ServerExamples\Repositories;
|
||||
|
||||
use League\OAuth2\Server\Entities\Interfaces\UserEntityInterface;
|
||||
use League\OAuth2\Server\Repositories\UserRepositoryInterface;
|
||||
use OAuth2ServerExamples\Entities\UserEntity;
|
||||
|
||||
class UserRepository implements UserRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* Get a user
|
||||
* Get a user entity
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*
|
||||
* @return UserEntityInterface
|
||||
* @return \League\OAuth2\Server\Entities\Interfaces\UserEntityInterface
|
||||
*/
|
||||
public function getByCredentials($username, $password)
|
||||
public function getUserEntityByUserCredentials($username, $password)
|
||||
{
|
||||
return new UserEntity();
|
||||
if ($username === 'alex' && $password === 'whisky') {
|
||||
return new UserEntity();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user