summaryrefslogtreecommitdiff
path: root/controllers/auth.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-02-14 21:03:39 -0800
committerAaron Parecki <aaron@parecki.com>2017-02-14 21:03:39 -0800
commit8c2cab9bdd51dabefe4d7c2c92ecdc5f06ef0613 (patch)
treef2fc6bccbac14f6f719fb96a06503e641e1240f8 /controllers/auth.php
parent5f89ca0552ba69d94af950503bf915bc19d633b1 (diff)
add reset login option
Diffstat (limited to 'controllers/auth.php')
-rw-r--r--controllers/auth.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/controllers/auth.php b/controllers/auth.php
index 15ecd61..9fd1493 100644
--- a/controllers/auth.php
+++ b/controllers/auth.php
@@ -267,6 +267,24 @@ $app->get('/signout', function() use($app) {
$app->redirect('/', 302);
});
+$app->post('/auth/reset', function() use($app) {
+ if($user=require_login($app, false)) {
+ $user->authorization_endpoint = '';
+ $user->token_endpoint = '';
+ $user->micropub_endpoint = '';
+ $user->authorization_endpoint = '';
+ $user->micropub_media_endpoint = '';
+ $user->micropub_scope = '';
+ $user->micropub_access_token = '';
+ $user->save();
+
+ unset($_SESSION['auth']);
+ unset($_SESSION['me']);
+ unset($_SESSION['auth_state']);
+ unset($_SESSION['user_id']);
+ }
+ $app->redirect('/', 302);
+});
$app->post('/auth/twitter', function() use($app) {
if($user=require_login($app, false)) {