A UK buyer can now create their own account at /portal/signup/. The screen creates a Keycloak user through a least-privilege service account (ixg-provisioning: manage-users, view-users) and the matching Django row as a buyer, then sends them through the normal sign-in flow to the portal. Staff status is derived from the role in the OIDC backend rather than asserted, so a self-registered buyer is not staff and does not become staff on a later sign-in. The platform root and the RBAC middleware now route each role to its own portal, which also fixes a redirect loop that the staff fix exposed for non-staff buyers.
34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from django.urls import path, include
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from rest_framework.authtoken import views as drf_auth
|
|
|
|
from apps.core.tiles import tile_view
|
|
from apps.core.views import RoleRedirectView
|
|
|
|
urlpatterns = [
|
|
path("", RoleRedirectView.as_view(), name="home"),
|
|
path("tiles/<int:z>/<int:x>/<int:y>.png", tile_view, name="tile"),
|
|
path("grappelli/", include("grappelli.urls")),
|
|
path("admin/", admin.site.urls),
|
|
path("oidc/", include("mozilla_django_oidc.urls")),
|
|
path("api/auth/", drf_auth.obtain_auth_token),
|
|
path("api/", include("apps.users.urls")),
|
|
path("api/", include("apps.subscriptions.urls")),
|
|
path("api/", include("apps.batches.urls")),
|
|
path("api/", include("apps.qc.urls")),
|
|
path("api/", include("apps.shipments.urls")),
|
|
path("api/", include("apps.documents.urls")),
|
|
path("api/", include("apps.capa.urls")),
|
|
path("api/", include("apps.esg.urls")),
|
|
path("api/", include("apps.compliance.urls")),
|
|
path("api/", include("apps.ai.urls")),
|
|
path("api/", include("apps.notifications.urls")),
|
|
path("ops/", include("apps.ops.urls")),
|
|
path("portal/", include("apps.buyer.urls")),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|