File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ set an authenticated token in the security context if successful.
138
138
try {
139
139
$authToken = $this->authenticationManager->authenticate($token);
140
140
141
- $this->securityContext->setToken($authToken);
141
+ return $this->securityContext->setToken($authToken);
142
142
} catch (AuthenticationException $failed) {
143
143
// ... you might log something here
144
144
@@ -152,6 +152,11 @@ set an authenticated token in the security context if successful.
152
152
$event->setResponse($response);
153
153
154
154
}
155
+
156
+ // By default deny authorization
157
+ $response = new Response();
158
+ $response->setStatusCode(403);
159
+ $event->setResponse($response);
155
160
}
156
161
}
157
162
@@ -233,6 +238,10 @@ the ``PasswordDigest`` header value matches with the user's password.
233
238
if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 > time()) {
234
239
throw new NonceExpiredException('Previously used nonce detected');
235
240
}
241
+ // If cache directory does not exist we create it
242
+ if ( !is_dir($this->cacheDir) ) {
243
+ mkdir($this->cacheDir, 0777, true);
244
+ }
236
245
file_put_contents($this->cacheDir.'/'.$nonce, time());
237
246
238
247
// Validate Secret
You can’t perform that action at this time.
0 commit comments