Netsach / concrete-datastore

A Highly Versatile REST Datastore built on top of Django
https://concrete-datastore.com
GNU General Public License v3.0
34 stars 17 forks source link

AnonymousUser self register #131

Closed KhaledBousrih closed 2 years ago

KhaledBousrih commented 2 years ago

Currently any user can be self registered to concrete datastore.

In some cases, we don't want that any user can be self-registered, so this must be enabled/disabled by a settings ENABLE_USERS_SELF_REGISTER default to True in order to keep the existant:

If ENABLE_USERS_SELF_REGISTER is False, we must fail any regiter request that have been performed by an anonymous user (not authenticated) => 400_BAD_REQUEST with the data

{
    "message": "Self register is not allowed",
    "_errors": ["NOT_ALLOWED_TO_SELF_REGISTER"]
}