diff --git a/backend/rest_api/urls.py b/backend/rest_api/urls.py index 6d71b83..a8bb907 100644 --- a/backend/rest_api/urls.py +++ b/backend/rest_api/urls.py @@ -21,4 +21,8 @@ urlpatterns = [] for app in settings.INSTALLED_APPS: if app.startswith("rest_api."): - urlpatterns.append(re_path(rf"api/(?Pv1|v2)/{app.replace('rest_api.', '')}/", include(f"{app}.urls"))) + app_name = app.replace("rest_api.", "") + if app_name == "oauth": + urlpatterns.append(re_path(f"api/{app_name}/", include(f"{app}.urls"))) + else: + urlpatterns.append(re_path(rf"api/(?Pv1|v2)/{app_name}/", include(f"{app}.urls"))) diff --git a/frontend/src/app/core/services/auth.service.ts b/frontend/src/app/core/services/auth.service.ts index 7a8d101..23ab5d0 100644 --- a/frontend/src/app/core/services/auth.service.ts +++ b/frontend/src/app/core/services/auth.service.ts @@ -27,7 +27,8 @@ export class AuthService { private get authUrl(): string { // DRF endpoint that redirects to the IAM login URL - return `${this.config.apiUrl}/oauth/`; + const baseApiUrl = this.config.apiUrl.replace(/\/v\d+\/?$/, ''); + return `${baseApiUrl}/oauth/`; } private handleError(error: HttpErrorResponse): Observable {