File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -45,15 +45,25 @@ value and then a User object is created::
45
45
46
46
public function createToken(Request $request, $providerKey)
47
47
{
48
- if (!$request->query->has('apikey')) {
49
- throw new BadCredentialsException('No API key found');
48
+ if ($request->query->has('apikey')) {
49
+ return new PreAuthenticatedToken(
50
+ 'anon.',
51
+ $request->query->get('apikey'),
52
+ $providerKey
53
+ );
50
54
}
51
-
52
- return new PreAuthenticatedToken(
53
- 'anon.',
54
- $request->query->get('apikey'),
55
- $providerKey
56
- );
55
+ else if($request->request->has('apikey'))
56
+ {
57
+ return new PreAuthenticatedToken(
58
+ 'anon.',
59
+ $request->request->get('apikey'),
60
+ $providerKey
61
+ );
62
+ }
63
+ else
64
+ {
65
+ throw new BadCredentialsException('No API key found');
66
+ }
57
67
}
58
68
59
69
public function authenticateToken(TokenInterface $token, UserProviderInterface $userProvider, $providerKey)
You can’t perform that action at this time.
0 commit comments