feat: make redirectUri token param follow OAuth2 standard (#1796)

* fix: rename token to access_token in implicit flow; change ? in the redirect uri to &

* fix typo
This commit is contained in:
Joe Zhang
2023-04-28 23:54:48 +08:00
committed by GitHub
parent da21c92815
commit fba4801a41

View File

@ -334,8 +334,9 @@ class LoginPage extends React.Component {
} else if (responseType === "code") { } else if (responseType === "code") {
this.postCodeLoginAction(res); this.postCodeLoginAction(res);
} else if (responseType === "token" || responseType === "id_token") { } else if (responseType === "token" || responseType === "id_token") {
const amendatoryResponseType = responseType === "token" ? "access_token" : responseType;
const accessToken = res.data; const accessToken = res.data;
Setting.goToLink(`${oAuthParams.redirectUri}#${responseType}=${accessToken}?state=${oAuthParams.state}&token_type=bearer`); Setting.goToLink(`${oAuthParams.redirectUri}#${amendatoryResponseType}=${accessToken}&state=${oAuthParams.state}&token_type=bearer`);
} else if (responseType === "saml") { } else if (responseType === "saml") {
if (res.data2.method === "POST") { if (res.data2.method === "POST") {
this.setState({ this.setState({