mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Make /jwt
return an Authorization
header for traefik
This commit is contained in:
parent
e6e2f8ce91
commit
825619b11d
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"maps"
|
||||
"net/http"
|
||||
"strings"
|
||||
@ -67,6 +68,7 @@ func (h *Handler) CreateJwt(c echo.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Response().Header().Add("Authorization", fmt.Sprintf("Bearer %s", t))
|
||||
return c.JSON(http.StatusOK, Jwt{
|
||||
Token: t,
|
||||
})
|
||||
|
@ -86,8 +86,8 @@ services:
|
||||
- "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
|
||||
- "traefik.http.routers.api.middlewares=phantom-token"
|
||||
- "traefik.http.middlewares.phantom-token.forwardauth.address=http://auth:4568/auth/jwt"
|
||||
- "traefik.http.middlewares.phantom-token.forwardauth.authResponseHeaders=Authorization"
|
||||
- "traefik.http.middlewares.phantom-token.forwardauth.authRequestHeaders=Authorization,X-Api-Key"
|
||||
- "traefik.http.middlewares.phantom-token.forwardauth.authResponseHeaders=Authorization"
|
||||
|
||||
# scanner:
|
||||
# build: ./scanner
|
||||
|
Loading…
x
Reference in New Issue
Block a user