From d540c87cfc8610ad05217d3b7317c5ddc758487c Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Mon, 10 Nov 2025 13:04:28 +0300 Subject: [PATCH] fix: Use uri-path instead of :external representation for API detection - Replace uri-to-url with :representation :external with uri-path - Fixes issue where full URLs like http://asteroid.radio.localhost were generated - .localhost domains resolve to 127.0.0.1 which breaks on remote servers - Path-only approach works for both local and remote deployments - Follows Radiance best practices: :external is only for redirect URLs --- user-management.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user-management.lisp b/user-management.lisp index 2967604..5017f74 100644 --- a/user-management.lisp +++ b/user-management.lisp @@ -151,7 +151,7 @@ If :api t, returns JSON error (401). Otherwise redirects to login page. Auto-detects API routes if not specified." (let* ((user-id (session:field "user-id")) - (uri (radiance:path (radiance:uri *request*))) + (uri (uri-path (radiance:uri *request*))) ;; Use explicit flag if provided, otherwise auto-detect from URI (is-api-request (if api t (search "/api/" uri)))) (format t "Authentication check - User ID: ~a, URI: ~a, Is API: ~a~%" @@ -178,7 +178,7 @@ If :api t, returns JSON error (403). Otherwise redirects to login page. Auto-detects API routes if not specified." (let* ((current-user (get-current-user)) - (uri (radiance:path (radiance:uri *request*))) + (uri (uri-path (radiance:uri *request*))) ;; Use explicit flag if provided, otherwise auto-detect from URI (is-api-request (if api t (search "/api/" uri)))) (format t "Current user for role check: ~a~%" (if current-user "FOUND" "NOT FOUND"))