mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-12 11:16:35 +00:00
Merge pull request #44 from WilliamB78/main
feat: add Remote-User header
This commit is contained in:
@@ -31,3 +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: X-Tinyauth-User
|
||||||
|
|||||||
@@ -29,3 +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: X-Tinyauth-User
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ func (api *API) SetupRoutes() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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{
|
||||||
"status": 200,
|
"status": 200,
|
||||||
|
|||||||
Reference in New Issue
Block a user