I am currently utilizing the user registration URL provided by Django Rest Auth:
urlpatterns = [
#...
path("registration/", include("dj_rest_auth.registration.urls")),
#...
]
This particular route involves email validation. However, I am interested in prevalidating email addresses before sending them to the server.
By applying a basic regex on the front end, some email addresses may pass through that are rejected by dj_rest_auth:
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)
For instance,
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="305170521e53">[email protected]</a>
may pass through but get rejected by Django.
I aim to align the client-side validation with the server side as closely as possible. What regex pattern does dj_rest_auth utilize for validation?