Tivix / django-rest-auth

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
www.tivix.com
MIT License
2.4k stars 663 forks source link

Custom URLs for registration are broken #323

Open blairg23 opened 7 years ago

blairg23 commented 7 years ago

In the documentation, Step 3 says to add rest_auth urls by doing the following:

urlpatterns = patterns('',
    ...,
    url(r'^rest-auth/', include('rest_auth.urls'))
) 

However, if you want to use a custom URL pattern, such as what I'm doing:

urlpatterns = [
    url(r'', include('django.contrib.auth.urls')),
    #
    # Administration
    #
    url(r'^admin_tools/', include('admin_tools.urls')),
    url(r'^admin/', admin.site.urls),
    #
    # Authentication
    #
    url(r'^api/auth/', include('rest_auth.urls')),
    #
    # Registration
    #
    url(r'^api/auth/register/', include('rest_auth.registration.urls')),
    #
    # Social Logins
    #
    url(r'^api/auth/twitter/$', views.TwitterLoginView.as_view(), name='login-twitter'),
    url(r'^api/auth/facebook/$', views.FacebookLoginView.as_view(), name='login-facebook'),
    url(r'^api/auth/google/$', views.GoogleLoginView.as_view(), name='login-google'),
    #
    # API Docs
    #
    url(r'^api/docs/', include('rest_framework_docs.urls')),
]

The URLs get a little funky (see screenshots below):

rest_auth_1


In particular, this piece at the bottom:

rest_auth_2

george-silva commented 6 years ago

Can reproduce.

In my case, this is giving me /api/v2/auth/api/v2/password/reset/ for example.