Accepts token in querystring

This commit is contained in:
2024-06-22 20:28:58 +08:00
parent d654931483
commit 4537bc9f28
3 changed files with 13 additions and 7 deletions

View File

@ -18,6 +18,9 @@ func AuthMiddleware(c *fiber.Ctx) error {
tk := strings.Replace(header, "Bearer", "", 1)
atk = strings.TrimSpace(tk)
}
if tk := c.Query("tk"); len(tk) > 0 {
atk = strings.TrimSpace(tk)
}
c.Locals("p_token", atk)