rename collection auth email verification to verify and add to collection schema json
This commit is contained in:
@@ -81,7 +81,7 @@ const Routes = () => {
|
||||
</Route>
|
||||
|
||||
{collections.map((collection) => {
|
||||
if (collection?.auth?.emailVerification) {
|
||||
if (collection?.auth?.verify) {
|
||||
return (
|
||||
<Route
|
||||
key={`${collection.slug}-verify`}
|
||||
|
||||
@@ -16,7 +16,7 @@ import './index.scss';
|
||||
const baseClass = 'auth-fields';
|
||||
|
||||
const Auth = (props) => {
|
||||
const { useAPIKey, requirePassword, emailVerification, collection: { slug }, email } = props;
|
||||
const { useAPIKey, requirePassword, verify, collection: { slug }, email } = props;
|
||||
const [changingPassword, setChangingPassword] = useState(requirePassword);
|
||||
const { getField } = useFormFields();
|
||||
const modified = useFormModified();
|
||||
@@ -117,7 +117,7 @@ const Auth = (props) => {
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{emailVerification && (
|
||||
{verify && (
|
||||
<Checkbox
|
||||
label="Verified"
|
||||
name="_verified"
|
||||
@@ -131,7 +131,7 @@ const Auth = (props) => {
|
||||
Auth.defaultProps = {
|
||||
useAPIKey: false,
|
||||
requirePassword: false,
|
||||
emailVerification: false,
|
||||
verify: false,
|
||||
collection: undefined,
|
||||
email: '',
|
||||
};
|
||||
@@ -139,7 +139,7 @@ Auth.defaultProps = {
|
||||
Auth.propTypes = {
|
||||
useAPIKey: PropTypes.bool,
|
||||
requirePassword: PropTypes.bool,
|
||||
emailVerification: PropTypes.bool,
|
||||
verify: PropTypes.bool,
|
||||
collection: PropTypes.shape({
|
||||
slug: PropTypes.string,
|
||||
}),
|
||||
|
||||
@@ -93,7 +93,7 @@ const DefaultEditView = (props) => {
|
||||
<Auth
|
||||
useAPIKey={auth.useAPIKey}
|
||||
requirePassword={!isEditing}
|
||||
emailVerification={auth.emailVerification}
|
||||
verify={auth.verify}
|
||||
collection={collection}
|
||||
email={data?.email}
|
||||
/>
|
||||
@@ -239,7 +239,10 @@ DefaultEditView.propTypes = {
|
||||
timestamps: PropTypes.bool,
|
||||
auth: PropTypes.shape({
|
||||
useAPIKey: PropTypes.bool,
|
||||
emailVerification: PropTypes.bool,
|
||||
verify: PropTypes.oneOfType([
|
||||
PropTypes.bool,
|
||||
PropTypes.object,
|
||||
]),
|
||||
maxLoginAttempts: PropTypes.number,
|
||||
}),
|
||||
upload: PropTypes.shape({}),
|
||||
|
||||
Reference in New Issue
Block a user