diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-05-31 09:55:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-31 09:55:18 +0200 |
commit | 0fec5324ac42490ca6028245560427189ce629cc (patch) | |
tree | 0adef9bef20034c72c854b68d1f2953b10684766 | |
parent | 06878535c45101d991492fedabd7b216e4dcad67 (diff) | |
parent | 5c3619c899951534d37b2970b2d0c1bf19866db2 (diff) | |
download | nextcloud-server-0fec5324ac42490ca6028245560427189ce629cc.tar.gz nextcloud-server-0fec5324ac42490ca6028245560427189ce629cc.zip |
Merge pull request #40120 from summersab/refactor/OC-Server-getCsrfTokenManager
-rw-r--r-- | lib/private/User/Session.php | 3 | ||||
-rw-r--r-- | lib/public/Util.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 9d77a90c541..e5d27172519 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -15,6 +15,7 @@ use OC\Authentication\Token\PublicKeyToken; use OC\Authentication\TwoFactorAuth\Manager as TwoFactorAuthManager; use OC\Hooks\Emitter; use OC\Hooks\PublicEmitter; +use OC\Security\CSRF\CsrfTokenManager; use OC_User; use OC_Util; use OCA\DAV\Connector\Sabre\Auth; @@ -531,7 +532,7 @@ class Session implements IUserSession, Emitter { if ($refreshCsrfToken) { // TODO: mock/inject/use non-static // Refresh the token - \OC::$server->getCsrfTokenManager()->refreshToken(); + \OC::$server->get(CsrfTokenManager::class)->refreshToken(); } if ($firstTimeLogin) { diff --git a/lib/public/Util.php b/lib/public/Util.php index 179d4066c9b..4cee9addf10 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -13,6 +13,7 @@ namespace OCP; use bantu\IniGetWrapper\IniGetWrapper; use OC\AppScriptDependency; use OC\AppScriptSort; +use OC\Security\CSRF\CsrfTokenManager; use OCP\L10N\IFactory; use OCP\Mail\IMailer; use OCP\Share\IManager; @@ -394,7 +395,7 @@ class Util { */ public static function callRegister() { if (self::$token === '') { - self::$token = \OC::$server->getCsrfTokenManager()->getToken()->getEncryptedValue(); + self::$token = \OC::$server->get(CsrfTokenManager::class)->getToken()->getEncryptedValue(); } return self::$token; } |