Finish /login/oauth/authorize

This commit is contained in:
Yang Luo
2021-03-20 22:34:22 +08:00
parent f89f454e0e
commit 808e6c6283
9 changed files with 22 additions and 26 deletions

View File

@ -21,28 +21,23 @@ import * as Util from "./Util";
class AuthCallback extends React.Component {
constructor(props) {
super(props);
const params = new URLSearchParams(this.props.location.search);
this.state = {
classes: props,
applicationName: props.match.params.applicationName,
providerName: props.match.params.providerName,
method: props.match.params.method,
state: params.get("state"),
code: params.get("code"),
isAuthenticated: false,
isSignedUp: false,
email: ""
};
}
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}`;
const body = {
application: this.state.applicationName,
provider: this.state.providerName,
code: this.state.code,
state: this.state.state,
code: params.get("code"),
state: params.get("state"),
redirectUri: redirectUri,
method: this.state.method,
};