feat: click on the app card to log in automatically (#1049)

This commit is contained in:
wenxuan70
2022-08-22 01:17:18 +08:00
committed by GitHub
parent 80a2263b18
commit fdf2b880cb
2 changed files with 18 additions and 4 deletions

View File

@ -504,7 +504,13 @@ class LoginPage extends React.Component {
}
renderSignedInBox() {
const params = new URLSearchParams(this.props.location.search);
const silentSignin = params.get("silentSignin");
if (this.props.account === undefined || this.props.account === null) {
if (window !== window.parent) {
const message = {tag: "Casdoor", type: "SilentSignin", data: "user-not-logged-in"};
window.parent.postMessage(message, "*");
}
return null;
}
const application = this.getApplicationObj();
@ -512,8 +518,6 @@ class LoginPage extends React.Component {
return null;
}
const params = new URLSearchParams(this.props.location.search);
const silentSignin = params.get("silentSignin");
if (silentSignin !== null) {
if (window !== window.parent) {
const message = {tag: "Casdoor", type: "SilentSignin", data: "signing-in"};