Skip to content

Commit f8fc281

Browse files
author
Jeidnx
committed
Add oidc delete capability
1 parent 0efeff0 commit f8fc281

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/LoginPage.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export default {
4747
};
4848
},
4949
mounted() {
50-
//TODO: Maybe there is a better way to do this?
51-
const urlParams = new URLSearchParams(window.location.search);
52-
const session = urlParams.get("session");
50+
const session = this.$route.query.session;
5351
if (session) {
5452
this.setPreference("authToken" + this.hashCode(this.authApiUrl()), session);
5553
this.$router.push("/");

src/components/PreferencesPage.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ export default {
473473
document.title = this.$t("titles.preferences") + " - Piped";
474474
},
475475
async mounted() {
476+
if (this.$route.query.deleted == this.getAuthToken()) this.logout();
476477
if (Object.keys(this.$route.query).length > 0) this.$router.replace({ query: {} });
477478
478479
this.fetchJson("https://piped-instances.kavin.rocks/").then(resp => {
@@ -611,7 +612,8 @@ export default {
611612
}),
612613
}).then(resp => {
613614
if (!resp.error) {
614-
this.logout();
615+
const redirect = resp.redirect;
616+
redirect ? (location.href = redirect) : this.logout();
615617
} else alert(resp.error);
616618
});
617619
},

0 commit comments

Comments
 (0)