mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 20:23:50 +08:00
Support quick sign-in.
This commit is contained in:
@ -21,6 +21,7 @@ import * as ApplicationBackend from "../backend/ApplicationBackend";
|
||||
import * as Provider from "./Provider";
|
||||
import * as Util from "./Util";
|
||||
import * as Setting from "../Setting";
|
||||
import SelfLoginButton from "./SelfLoginButton";
|
||||
import {GithubLoginButton, GoogleLoginButton} from "react-social-login-buttons";
|
||||
import FacebookLoginButton from "./FacebookLoginButton";
|
||||
import QqLoginButton from "./QqLoginButton";
|
||||
@ -380,6 +381,31 @@ class LoginPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
renderSignedInBox() {
|
||||
if (this.props.account === undefined || this.props.account === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{fontSize: 16, textAlign: "left"}}>
|
||||
{i18next.t("login:Continue with")} :
|
||||
</div>
|
||||
<br/>
|
||||
<SelfLoginButton account={this.props.account} onClick={() => {
|
||||
let values = {};
|
||||
values["application"] = this.state.application.name;
|
||||
this.onFinish(values);
|
||||
}} />
|
||||
<br/>
|
||||
<br/>
|
||||
<div style={{fontSize: 16, textAlign: "left"}}>
|
||||
{i18next.t("login:Or sign in with another account")} :
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
const application = this.getApplicationObj();
|
||||
if (application === null) {
|
||||
@ -409,6 +435,9 @@ class LoginPage extends React.Component {
|
||||
{/*{*/}
|
||||
{/* this.state.clientId !== null ? "Redirect" : null*/}
|
||||
{/*}*/}
|
||||
{
|
||||
this.renderSignedInBox()
|
||||
}
|
||||
{
|
||||
this.renderForm(application)
|
||||
}
|
||||
|
Reference in New Issue
Block a user