🐛 Bug fixes on auth

This commit is contained in:
2024-10-30 23:26:39 +08:00
parent ae3583ead1
commit a785adfafa
2 changed files with 4 additions and 8 deletions

View File

@ -29,9 +29,9 @@ func forwardService(c *fiber.Ctx) error {
url = *service.HttpAddr + url
if tk, ok := c.Locals("nex_token").(string); ok {
c.Set(fiber.HeaderAuthorization, fmt.Sprintf("Bearer %s", tk))
c.Request().Header.Set(fiber.HeaderAuthorization, fmt.Sprintf("Bearer %s", tk))
} else {
c.Set(fiber.HeaderAuthorization, "")
c.Request().Header.Del(fiber.HeaderAuthorization)
}
return proxy.Do(c, url)