Fix double GET params issue, fix double state bug.

This commit is contained in:
Yang Luo
2021-03-20 23:50:34 +08:00
parent 808e6c6283
commit 8b921b2c1e
3 changed files with 7 additions and 7 deletions

View File

@ -31,8 +31,7 @@ class AuthCallback extends React.Component {
componentWillMount() {
const params = new URLSearchParams(this.props.location.search);
let redirectUri;
redirectUri = `${window.location.origin}/callback/${this.state.applicationName}/${this.state.providerName}/${this.state.method}`;
let redirectUri = `${window.location.origin}/callback/${this.state.applicationName}/${this.state.providerName}/${this.state.method}`;
const body = {
application: this.state.applicationName,
provider: this.state.providerName,

View File

@ -43,7 +43,7 @@ export function getAuthLogo(provider) {
}
export function getAuthUrl(application, provider, method) {
const redirectUri = `${window.location.origin}/callback/${application.name}/${provider.name}/${method}`;
const redirectUri = `${window.location.origin}/callback/${application.name}/${provider.name}/${method}${encodeURIComponent(window.location.search)}`;
if (provider.type === "google") {
return `${GoogleAuthUri}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${GoogleAuthScope}&response_type=code&state=${AuthState}`;
} else if (provider.type === "github") {