mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 18:33:50 +08:00
Simplify callback URL.
This commit is contained in:
@ -24,9 +24,6 @@ class AuthCallback extends React.Component {
|
||||
super(props);
|
||||
this.state = {
|
||||
classes: props,
|
||||
applicationName: props.match.params.applicationName,
|
||||
providerName: props.match.params.providerName,
|
||||
method: props.match.params.method,
|
||||
};
|
||||
}
|
||||
|
||||
@ -57,15 +54,18 @@ class AuthCallback extends React.Component {
|
||||
componentWillMount() {
|
||||
const params = new URLSearchParams(this.props.location.search);
|
||||
const innerParams = this.getInnerParams();
|
||||
let redirectUri = `${window.location.origin}/callback/${this.state.applicationName}/${this.state.providerName}/${this.state.method}`;
|
||||
const applicationName = innerParams.get("application");
|
||||
const providerName = innerParams.get("provider");
|
||||
const method = innerParams.get("method");
|
||||
let redirectUri = `${window.location.origin}/callback`;
|
||||
const body = {
|
||||
type: this.getResponseType(),
|
||||
application: this.state.applicationName,
|
||||
provider: this.state.providerName,
|
||||
application: applicationName,
|
||||
provider: providerName,
|
||||
code: params.get("code"),
|
||||
state: innerParams.get("state"),
|
||||
redirectUri: redirectUri,
|
||||
method: this.state.method,
|
||||
method: method,
|
||||
};
|
||||
const oAuthParams = Util.getOAuthGetParameters(innerParams);
|
||||
AuthBackend.login(body, oAuthParams)
|
||||
|
Reference in New Issue
Block a user