Add oidc delete capability

This commit is contained in:
Jeidnx 2023-10-26 13:43:19 +02:00
parent 0efeff0098
commit f8fc281284
No known key found for this signature in database
GPG key ID: 0E9E697B7E99DF39
2 changed files with 4 additions and 4 deletions

View file

@ -47,9 +47,7 @@ export default {
};
},
mounted() {
//TODO: Maybe there is a better way to do this?
const urlParams = new URLSearchParams(window.location.search);
const session = urlParams.get("session");
const session = this.$route.query.session;
if (session) {
this.setPreference("authToken" + this.hashCode(this.authApiUrl()), session);
this.$router.push("/");

View file

@ -473,6 +473,7 @@ export default {
document.title = this.$t("titles.preferences") + " - Piped";
},
async mounted() {
if (this.$route.query.deleted == this.getAuthToken()) this.logout();
if (Object.keys(this.$route.query).length > 0) this.$router.replace({ query: {} });
this.fetchJson("https://piped-instances.kavin.rocks/").then(resp => {
@ -611,7 +612,8 @@ export default {
}),
}).then(resp => {
if (!resp.error) {
this.logout();
const redirect = resp.redirect;
redirect ? (location.href = redirect) : this.logout();
} else alert(resp.error);
});
},