Skip to content

Commit

Permalink
Fixed broken auth calls
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung committed Jun 22, 2023
1 parent 4db46fb commit 8dc38ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Demo/Auth/DummyAuthenticationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function authenticate(IRequest $request, AuthenticationScheme $scheme): A
$queryString = $this->requestParser->parseQueryString($request);

if (!$queryString->containsKey('letMeIn') || !$queryString->containsKey('userId')) {
return AuthenticationResult::fail('Could not authenticate user');
return AuthenticationResult::fail('Could not authenticate user', $scheme->name);
}

try {
$currUser = $this->users->getUserById((int)$queryString->get('userId'));
} catch (UserNotFoundException) {
return AuthenticationResult::fail('No user with this ID found');
return AuthenticationResult::fail('No user with this ID found', $scheme->name);
}

$claimsIssuer = $scheme->options->claimsIssuer ?? $scheme->name;
Expand All @@ -67,7 +67,7 @@ public function authenticate(IRequest $request, AuthenticationScheme $scheme): A
new Claim(ClaimType::Email, $currUser->email, $claimsIssuer)
];

return AuthenticationResult::pass(new User(new Identity($claims)));
return AuthenticationResult::pass(new User(new Identity($claims)), $scheme->name);
}

/**
Expand Down

0 comments on commit 8dc38ca

Please sign in to comment.