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