File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,7 @@ export default {
47
47
};
48
48
},
49
49
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 ;
53
51
if (session) {
54
52
this .setPreference (" authToken" + this .hashCode (this .authApiUrl ()), session);
55
53
this .$router .push (" /" );
Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ export default {
473
473
document .title = this .$t (" titles.preferences" ) + " - Piped" ;
474
474
},
475
475
async mounted () {
476
+ if (this .$route .query .deleted == this .getAuthToken ()) this .logout ();
476
477
if (Object .keys (this .$route .query ).length > 0 ) this .$router .replace ({ query: {} });
477
478
478
479
this .fetchJson (" https://piped-instances.kavin.rocks/" ).then (resp => {
@@ -611,7 +612,8 @@ export default {
611
612
}),
612
613
}).then (resp => {
613
614
if (! resp .error ) {
614
- this .logout ();
615
+ const redirect = resp .redirect ;
616
+ redirect ? (location .href = redirect) : this .logout ();
615
617
} else alert (resp .error );
616
618
});
617
619
},
You can’t perform that action at this time.
0 commit comments