mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
[mastodon-client] Correctly implement multiple callback URIs for OAuth, resolves #150
This commit is contained in:
parent
29099e4635
commit
5d1a61cb95
@ -111,7 +111,13 @@ export default defineComponent({
|
||||
}, {});
|
||||
const isMastodon = !!getUrlParams().mastodon;
|
||||
if (this.session.app.callbackUrl && isMastodon) {
|
||||
const callbackUrl = new URL(this.session.app.callbackUrl);
|
||||
const redirectUri = decodeURIComponent(getUrlParams().redirect_uri);
|
||||
if (!this.session.app.callbackUrl.split('\n').some(p => p === redirectUri)){
|
||||
this.state = "fetch-session-error";
|
||||
this.fetching = false;
|
||||
throw new Error("callback uri doesn't match registered app");
|
||||
}
|
||||
const callbackUrl = new URL(redirectUri)
|
||||
callbackUrl.searchParams.append("code", this.session.token);
|
||||
if (!!getUrlParams().state)
|
||||
callbackUrl.searchParams.append(
|
||||
|
Loading…
Reference in New Issue
Block a user