0

I want to know if I can modify the URL path if I try going the Application page for Oauth2 when I am not logged in. Basically, I want to reuse the Admin login for the user to login and then redirect them to the Application page.

# Current URL
http://localhost:8000/accounts/login/?next=/o/applications/

# Desired URL
# Change 'accounts' to 'admin'
http://localhost:8000/admin/login/?next=/o/applications/

Note: I got the response I want with the following approach in my root urls.py:

urlpatterns = [
    path('admin/', admin.site.urls, name="admin"),
    path('accounts/', admin.site.urls, name="account_auth"),
    path('o/', include('oauth2_provider.urls', namespace='oath2_provider')),
]

With this, I don't have to change the path but I feel like it's not the right way to do (2 paths/routes for 1 view).

G.Huan
  • 143
  • 1
  • 7

0 Answers0