File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ This requires you to implement six methods::
175
175
}
176
176
177
177
// What you return here will be passed to getUser() as $credentials
178
- return array(
178
+ return [
179
179
'token' => $token,
180
- ) ;
180
+ ] ;
181
181
}
182
182
183
183
public function getUser($credentials, UserProviderInterface $userProvider)
@@ -206,27 +206,27 @@ This requires you to implement six methods::
206
206
207
207
public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
208
208
{
209
- $data = array(
209
+ $data = [
210
210
'message' => strtr($exception->getMessageKey(), $exception->getMessageData())
211
211
212
212
// or to translate this message
213
213
// $this->translator->trans($exception->getMessageKey(), $exception->getMessageData())
214
- ) ;
214
+ ] ;
215
215
216
- return new JsonResponse($data, 403 );
216
+ return new JsonResponse($data, Response::HTTP_FORBIDDEN );
217
217
}
218
218
219
219
/**
220
220
* Called when authentication is needed, but it's not sent
221
221
*/
222
222
public function start(Request $request, AuthenticationException $authException = null)
223
223
{
224
- $data = array(
224
+ $data = [
225
225
// you might translate this message
226
226
'message' => 'Authentication Required'
227
- ) ;
227
+ ] ;
228
228
229
- return new JsonResponse($data, 401 );
229
+ return new JsonResponse($data, Response::HTTP_UNAUTHORIZED );
230
230
}
231
231
232
232
public function supportsRememberMe()
You can’t perform that action at this time.
0 commit comments