feat: add regex to restrict Email addresses in OAuth provider (#3465)

* feat: support use regex expression to limit email receiver address

* feat: limit in correct pos

* feat: promote code format

* feat: promote code format

* fix: fix linter issue
This commit is contained in:
DacongDA
2025-01-02 00:00:57 +08:00
committed by GitHub
parent b57b64fc36
commit 888a6f2feb
3 changed files with 42 additions and 0 deletions

View File

@ -633,6 +633,20 @@ class ProviderEditPage extends React.Component {
</React.Fragment>
)
}
{
this.state.provider.category === "OAuth" ? (
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("provider:Email regex"), i18next.t("provider:Email regex - Tooltip"))} :
</Col>
<Col span={22}>
<TextArea rows={4} value={this.state.provider.emailRegex} onChange={e => {
this.updateProviderField("emailRegex", e.target.value);
}} />
</Col>
</Row>
) : null
}
{
this.state.provider.type === "Custom" ? (
<React.Fragment>