diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-05-19 11:20:22 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-05-23 09:11:12 +0200 |
commit | 74277c25be2f3231e52a73a684bd14452a9ff2aa (patch) | |
tree | ca68eac57db357563e64e9f323df667fcc28f8f6 /settings/Controller | |
parent | 6495534bcdbbda8aa2748cc9f5d94dcb2bc7a04a (diff) | |
download | nextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.tar.gz nextcloud-server-74277c25be2f3231e52a73a684bd14452a9ff2aa.zip |
add button to invalidate browser sessions/device tokens
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/AuthSettingsController.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php index 71868b7688d..75311920d2a 100644 --- a/settings/Controller/AuthSettingsController.php +++ b/settings/Controller/AuthSettingsController.php @@ -60,7 +60,8 @@ class AuthSettingsController extends Controller { * @param ISecureRandom $random * @param string $uid */ - public function __construct($appName, IRequest $request, IProvider $tokenProvider, IUserManager $userManager, ISession $session, ISecureRandom $random, $uid) { + public function __construct($appName, IRequest $request, IProvider $tokenProvider, IUserManager $userManager, + ISession $session, ISecureRandom $random, $uid) { parent::__construct($appName, $request); $this->tokenProvider = $tokenProvider; $this->userManager = $userManager; @@ -131,4 +132,20 @@ class AuthSettingsController extends Controller { return implode('-', $groups); } + /** + * @NoAdminRequired + * @NoSubadminRequired + * + * @return JSONResponse + */ + public function destroy($id) { + $user = $this->userManager->get($this->uid); + if (is_null($user)) { + return []; + } + + $this->tokenProvider->invalidateTokenById($user, $id); + return []; + } + } |