[mastodon-client] Preserve state parameter during OAuth

This fixes login with clients that require the state parameter to be preserved during /oauth/authorize.
This commit is contained in:
Laura Hausmann 2023-11-27 23:25:35 +01:00
parent 89bc799765
commit 58137c9482
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
2 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,7 @@ const props = defineProps<{
scope?: string; scope?: string;
force_login?: boolean; force_login?: boolean;
lang?: string; lang?: string;
state?: string;
}>(); }>();
const _scopes = props.scope?.split(" ")?.filter(p => p.length > 0) ?? ['read']; const _scopes = props.scope?.split(" ")?.filter(p => p.length > 0) ?? ['read'];
@ -165,6 +166,7 @@ async function accept(): Promise<void> {
redirectUri, redirectUri,
query({ query({
code: res.code, code: res.code,
state: props.state,
}), }),
); );
} }

View File

@ -354,7 +354,8 @@ export const routes = [
redirect_uri: "redirect_uri", redirect_uri: "redirect_uri",
scope: "scope", scope: "scope",
force_login: "force_login", force_login: "force_login",
lang: "lang" lang: "lang",
state: "state",
} }
}, },
{ {