[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
Signed by: zotan
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",
} }
}, },
{ {