aboutsummaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-19 11:20:22 +0200
committerChristoph Wurst <christoph@owncloud.com>2016-05-23 09:11:12 +0200
commit74277c25be2f3231e52a73a684bd14452a9ff2aa (patch)
treeca68eac57db357563e64e9f323df667fcc28f8f6 /settings/Controller
parent6495534bcdbbda8aa2748cc9f5d94dcb2bc7a04a (diff)
downloadnextcloud-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.php19
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 [];
+ }
+
}