]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
move dir check into constructor
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Security / Authentication / Provider / WsseProvider.php
index c9b9b692f01d08f06c3ce16995d80e5676b72b51..7e6a5dfb3960f30f78043df38a0485cddf6b1c52 100644 (file)
@@ -17,6 +17,11 @@ class WsseProvider implements AuthenticationProviderInterface
     {
         $this->userProvider = $userProvider;
         $this->cacheDir     = $cacheDir;
+
+        // If cache directory does not exist we create it
+        if (!is_dir($this->cacheDir)) {
+            mkdir($this->cacheDir, 0777, true);
+        }
     }
 
     public function authenticate(TokenInterface $token)
@@ -54,11 +59,6 @@ class WsseProvider implements AuthenticationProviderInterface
             throw new NonceExpiredException('Previously used nonce detected');
         }
 
-        // If cache directory does not exist we create it
-        if (!is_dir($this->cacheDir)) {
-            mkdir($this->cacheDir, 0777, true);
-        }
-
         file_put_contents($this->cacheDir.'/'.$nonce, time());
 
         // Validate Secret