diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 12976d1..9e3f6d8 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,9 @@
-
-
-
-
+
+
+
@@ -144,7 +143,6 @@
-
@@ -169,7 +167,8 @@
-
+
+
true
diff --git a/pkg/hyper/auth_adaptor.go b/pkg/hyper/auth_adaptor.go
index f483560..9ac43cf 100644
--- a/pkg/hyper/auth_adaptor.go
+++ b/pkg/hyper/auth_adaptor.go
@@ -20,10 +20,14 @@ func (v *HyperConn) 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)
- if user, newAtk, newRtk, err := v.DoAuthenticate(atk, c.Cookies(CookieRtk)); err == nil {
+ rtk := c.Cookies(CookieRtk)
+ if user, newAtk, newRtk, err := v.DoAuthenticate(atk, rtk); err == nil {
if newAtk != atk {
c.Cookie(&fiber.Cookie{
Name: CookieAtk,
diff --git a/pkg/internal/server/exts/auth.go b/pkg/internal/server/exts/auth.go
index 5ebc09c..4d5241a 100644
--- a/pkg/internal/server/exts/auth.go
+++ b/pkg/internal/server/exts/auth.go
@@ -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)