Improve OAuth params.

This commit is contained in:
Yang Luo
2021-08-01 11:20:06 +08:00
parent 3be7d3b273
commit 629ae5a54b
6 changed files with 338 additions and 12 deletions

View File

@ -68,7 +68,11 @@ class AuthCallback extends React.Component {
UNSAFE_componentWillMount() {
const params = new URLSearchParams(this.props.location.search);
const code = params.get("code");
let code = params.get("code");
// WeCom returns "auth_code=xxx" instead of "code=xxx"
if (code === null) {
code = params.get("auth_code");
}
const innerParams = this.getInnerParams();
const applicationName = innerParams.get("application");