mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 03:53:50 +08:00
feat: support google one tap signin (#2131)
* feat: add google one tap support * feat: gofumpt * feat: add google provider rule conf * feat: update i18n
This commit is contained in:
@ -36,7 +36,7 @@ import {CaptchaModal} from "../common/modal/CaptchaModal";
|
||||
import {CaptchaRule} from "../common/modal/CaptchaModal";
|
||||
import RedirectForm from "../common/RedirectForm";
|
||||
import {MfaAuthVerifyForm, NextMfa, RequiredMfa} from "./mfa/MfaAuthVerifyForm";
|
||||
|
||||
import {GoogleOneTapLoginVirtualButton} from "./GoogleLoginButton";
|
||||
class LoginPage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@ -423,6 +423,16 @@ class LoginPage extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
renderOtherFormProvider(application) {
|
||||
for (const providerConf of application.providers) {
|
||||
if (providerConf.provider?.type === "Google" && providerConf.rule === "OneTap" && this.props.preview !== "auto") {
|
||||
return (
|
||||
<GoogleOneTapLoginVirtualButton application={application} providerConf={providerConf} />
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderForm(application) {
|
||||
if (this.state.msg !== null) {
|
||||
return Util.renderMessage(this.state.msg);
|
||||
@ -580,6 +590,9 @@ class LoginPage extends React.Component {
|
||||
return ProviderButton.renderProviderLogo(providerItem.provider, application, 30, 5, "small", this.props.location);
|
||||
})
|
||||
}
|
||||
{
|
||||
this.renderOtherFormProvider(application)
|
||||
}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
);
|
||||
@ -601,6 +614,9 @@ class LoginPage extends React.Component {
|
||||
return ProviderButton.renderProviderLogo(providerItem.provider, application, 40, 10, "big", this.props.location);
|
||||
})
|
||||
}
|
||||
{
|
||||
this.renderOtherFormProvider(application)
|
||||
}
|
||||
<div>
|
||||
<br />
|
||||
{
|
||||
|
Reference in New Issue
Block a user