mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
feat: check signup item email regex in signup page (#2960)
* feat: check email regex in frontend * Update SignupPage.js --------- Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
parent
6efec6b4b5
commit
c48306d117
@ -389,6 +389,14 @@ class SignupPage extends React.Component {
|
||||
return Promise.reject(i18next.t("signup:The input is not valid Email!"));
|
||||
}
|
||||
|
||||
if (signupItem.regex) {
|
||||
const reg = new RegExp(signupItem.regex);
|
||||
if (!reg.test(this.state.email)) {
|
||||
this.setState({validEmail: false});
|
||||
return Promise.reject(i18next.t("signup:The input Email doesn't match the signup item regex!"));
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({validEmail: true});
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user