@@ -606,7 +606,7 @@ Create User
606
606
607
607
POST /api/v1/users/user/
608
608
609
- **Note **: Passing ``true `` to the optional
609
+ **Note **: Passing ``true `` to the optional
610
610
``is_verified `` field allows creating users with
611
611
their email address flagged as verified. This will
612
612
also skip sending the verification link to their
@@ -803,27 +803,30 @@ Usage example:
803
803
Authentication Backend
804
804
----------------------
805
805
806
- The authentication backend in `` openwisp_users.backends.UsersAuthenticationBackend ``
807
- allows users to authenticate using their
808
- ``email `` or ``phone_number `` instead of their `` username ``.
809
- Authenticating with the ``username `` is still allowed,
810
- but ``email `` has precedence.
806
+ The authentication backend in
807
+ `` openwisp_users.backends.UsersAuthenticationBackend ``
808
+ allows users to authenticate using their ``email `` or ``phone_number ``
809
+ instead of their `` username ``. Authenticating with the ``username `` is
810
+ still supported, but ``email `` takes precedence.
811
811
812
- If the username string passed is parsed as a valid phone number, then
813
- ``phone_number `` has precedence.
812
+ If the provided username string is parsed as a valid phone number, then
813
+ ``phone_number `` takes precedence.
814
814
815
- Phone numbers are parsed using the ``phonenumbers `` library, which means
816
- that even if the user adds characters like spaces, dots or dashes, the number
817
- will be recognized anyway.
815
+ Phone numbers are parsed using the
816
+ `phonenumbers <https://github.com/daviddrysdale/python-phonenumbers >`_
817
+ library, which ensures that numbers are recognized even if users
818
+ include characters like spaces, dots, or dashes.
818
819
819
- When parsing phone numbers, the
820
- `OPENWISP_USERS_AUTH_BACKEND_AUTO_PREFIXES
821
- <#openwisp_users_auth_backend_auto_prefixes> `_
822
- setting allows to specify a list of international prefixes that can
823
- be prepended to the username string automatically in order to allow
824
- users to log in without having to type the international prefix.
820
+ The ``OPENWISP_USERS_AUTH_BACKEND_AUTO_PREFIXES `` setting allows specifying
821
+ a list of international prefixes that can be automatically prepended to the
822
+ username string, enabling users to log in without typing the international
823
+ prefix.
825
824
826
- The authentication backend can also be used as follows:
825
+ Additionally, the backend supports phone numbers with a leading zero, which
826
+ is common in some countries for local numbers. This ensures users can
827
+ authenticate successfully even if they include the leading zero.
828
+
829
+ The authentication backend can also be used programmatically, for example:
827
830
828
831
.. code-block :: python
829
832
0 commit comments