feat: add Remote-User header

This commit is contained in:
WilliamB78
2025-03-04 09:59:42 +01:00
parent fc3f8b5036
commit 7e0bc84b0f
3 changed files with 4 additions and 0 deletions

View File

@@ -31,3 +31,4 @@ services:
traefik.http.routers.tinyauth.rule: Host(`tinyauth.dev.local`)
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.authResponseHeaders: Remote-User

View File

@@ -29,3 +29,4 @@ services:
traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`)
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.authResponseHeaders: Remote-User

View File

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