Remove AddTrailingSlash middleware that broke admin panel
The AddTrailingSlash() Pre middleware was redirecting requests like /api/admin/users to /api/admin/users/, but admin routes were registered without trailing slashes, causing routes to not match (404/401 errors). Mobile API routes already have trailing slashes explicitly defined, so this middleware was unnecessary and caused conflicts. Also fix APNS_AUTH_KEY_PATH to use environment variable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,7 @@ services:
|
|||||||
EMAIL_USE_TLS: "${EMAIL_USE_TLS:-true}"
|
EMAIL_USE_TLS: "${EMAIL_USE_TLS:-true}"
|
||||||
|
|
||||||
# Push Notifications (Direct APNs/FCM - no Gorush)
|
# Push Notifications (Direct APNs/FCM - no Gorush)
|
||||||
APNS_AUTH_KEY_PATH: "/certs/apns_key.p8"
|
APNS_AUTH_KEY_PATH: ${APNS_AUTH_KEY_PATH}
|
||||||
APNS_AUTH_KEY_ID: ${APNS_AUTH_KEY_ID}
|
APNS_AUTH_KEY_ID: ${APNS_AUTH_KEY_ID}
|
||||||
APNS_TEAM_ID: ${APNS_TEAM_ID}
|
APNS_TEAM_ID: ${APNS_TEAM_ID}
|
||||||
APNS_TOPIC: ${APNS_TOPIC:-com.example.casera}
|
APNS_TOPIC: ${APNS_TOPIC:-com.example.casera}
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ func SetupRouter(deps *Dependencies) *echo.Echo {
|
|||||||
e.Validator = customvalidator.NewCustomValidator()
|
e.Validator = customvalidator.NewCustomValidator()
|
||||||
e.HTTPErrorHandler = customHTTPErrorHandler
|
e.HTTPErrorHandler = customHTTPErrorHandler
|
||||||
|
|
||||||
// Add trailing slash middleware (before other middleware)
|
// NOTE: Removed AddTrailingSlash() middleware - it conflicted with admin routes
|
||||||
e.Pre(middleware.AddTrailingSlash())
|
// which don't use trailing slashes. Mobile API routes explicitly include trailing slashes.
|
||||||
|
|
||||||
// Global middleware
|
// Global middleware
|
||||||
e.Use(utils.EchoRecovery())
|
e.Use(utils.EchoRecovery())
|
||||||
|
|||||||
Reference in New Issue
Block a user