Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Castelnuovo committed Apr 14, 2021
1 parent fdae3ed commit 0a20ad8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/OAuth/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use CQ\OAuth\Flows\FlowProvider;
use CQ\OAuth\Models\TokenModel;
use CQ\OAuth\Models\User;
use CQ\OAuth\Models\UserModel;
use CQ\Request\Request;

final class Client
Expand Down Expand Up @@ -84,7 +84,7 @@ public function logout(): string
/**
* Get user info and check if user is allowed to login
*/
public function getUser(string $accessToken): User
public function getUser(string $accessToken): UserModel
{
$user = Request::send(
method: 'GET',
Expand All @@ -96,11 +96,11 @@ public function getUser(string $accessToken): User

$allowed = true;

if (! $user?->email_verified || ! $user?->roles) {
if (!$user?->email_verified || !$user?->roles) {
$allowed = false;
}

return new User(
return new UserModel(
allowed: $allowed,
id: $user->sub,
email: $user->email,
Expand Down

0 comments on commit 0a20ad8

Please sign in to comment.