From c1fd36862eef649cab1d49fc8190224d0fac9478 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 20 Jul 2022 18:21:11 +0200 Subject: [PATCH 1/2] log out all devices --- src/components/PreferencesPage.vue | 18 ++++++++++++++++++ src/locales/en.json | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 34b8fd6c..a2dd8649 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -227,6 +227,12 @@
+
@@ -480,6 +486,18 @@ export default { // redirect to trending page window.location = "/"; }, + async invalidateSession() { + this.fetchJson(this.apiUrl() + "/logout", null, { + method: "POST", + headers: { + Authorization: this.getAuthToken(), + }, + }).then(resp => { + if (!resp.error) { + this.logout(); + } else alert(resp.error); + }); + }, }, }; diff --git a/src/locales/en.json b/src/locales/en.json index 1909e9d4..abdc1d8a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -82,8 +82,9 @@ "delete_playlist_confirm": "Are you sure you want to delete this playlist?", "please_select_playlist": "Please select a playlist", "delete_account": "Delete Account", - "logout": "Logout", - "minimize_recommendations_default": "Minimize Recommendations by default" + "logout": "Log out this device", + "minimize_recommendations_default": "Minimize Recommendations by default", + "invalidate_session": "Log out all devices" }, "comment": { "pinned_by": "Pinned by" From 24a37d4eb4552ed4187163dd34c357db63d6bdb9 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 20 Jul 2022 18:45:50 +0200 Subject: [PATCH 2/2] change strings --- src/locales/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index abdc1d8a..eb4e8820 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -82,9 +82,9 @@ "delete_playlist_confirm": "Are you sure you want to delete this playlist?", "please_select_playlist": "Please select a playlist", "delete_account": "Delete Account", - "logout": "Log out this device", + "logout": "Logout from this device", "minimize_recommendations_default": "Minimize Recommendations by default", - "invalidate_session": "Log out all devices" + "invalidate_session": "Logout all devices" }, "comment": { "pinned_by": "Pinned by"