refactor: rename remote user to x tinyauth user

This commit is contained in:
Stavros
2025-03-04 16:00:28 +02:00
parent 7e0bc84b0f
commit 33904f7f86
3 changed files with 4 additions and 3 deletions

View File

@@ -31,4 +31,4 @@ services:
traefik.http.routers.tinyauth.rule: Host(`tinyauth.dev.local`) traefik.http.routers.tinyauth.rule: Host(`tinyauth.dev.local`)
traefik.http.services.tinyauth.loadbalancer.server.port: 3000 traefik.http.services.tinyauth.loadbalancer.server.port: 3000
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik
traefik.http.middlewares.tinyauth.forwardauth.authResponseHeaders: Remote-User traefik.http.middlewares.tinyauth.forwardauth.authResponseHeaders: X-Tinyauth-User

View File

@@ -29,4 +29,4 @@ services:
traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`) traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`)
traefik.http.services.tinyauth.loadbalancer.server.port: 3000 traefik.http.services.tinyauth.loadbalancer.server.port: 3000
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik
traefik.http.middlewares.tinyauth.forwardauth.authResponseHeaders: Remote-User traefik.http.middlewares.tinyauth.forwardauth.authResponseHeaders: X-Tinyauth-User

View File

@@ -235,7 +235,8 @@ func (api *API) SetupRoutes() {
return return
} }
c.Header("Remote-User", userContext.Username) // Set the user header
c.Header("X-Tinyauth-User", userContext.Username)
// The user is allowed to access the app // The user is allowed to access the app
c.JSON(200, gin.H{ c.JSON(200, gin.H{