feat: enforce acceptance of terms and conditions for social logins (#3087)

* feat: Enforce acceptance of terms and conditions for social logins (#2975)

* feat: add error message for agreement acceptance
This commit is contained in:
千石
2024-07-29 17:22:48 +08:00
committed by GitHub
parent 365449695b
commit 79b934d6c2
2 changed files with 29 additions and 7 deletions

View File

@ -13,7 +13,7 @@
// limitations under the License.
import React from "react";
import {Button, Form, Input, Radio, Result, Row} from "antd";
import {Button, Form, Input, Radio, Result, Row, message} from "antd";
import * as Setting from "../Setting";
import * as AuthBackend from "./AuthBackend";
import * as ProviderButton from "./ProviderButton";
@ -653,8 +653,19 @@ class SignupPage extends React.Component {
}
return (
application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map(providerItem => {
return ProviderButton.renderProviderLogo(providerItem.provider, application, null, null, signupItem.rule, this.props.location);
application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map((providerItem, id) => {
return (
<span key={id} onClick={(e) => {
if (!this.form.current.getFieldValue("agreement")) {
e.preventDefault();
message.error(i18next.t("signup:Please accept the agreement!"));
}
}}>
{
ProviderButton.renderProviderLogo(providerItem.provider, application, null, null, signupItem.rule, this.props.location)
}
</span>
);
})
);