mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +05:30
Added ability to cast token as a string
This commit is contained in:
parent
d40ee11ef5
commit
11664e6d37
@ -147,6 +147,19 @@ abstract class AbstractTokenEntity
|
||||
return $scopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the token as a string if the object is cast as a string
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (is_null($this->token)) {
|
||||
throw new \BadMethodCallException('Token is null');
|
||||
}
|
||||
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expire the token
|
||||
* @return void
|
||||
|
Loading…
Reference in New Issue
Block a user