Restore token auth for cross-origin access

This commit is contained in:
lpf
2026-03-16 17:34:09 +08:00
parent 2bef01f820
commit 5a6a455f43
2 changed files with 5 additions and 2 deletions

View File

@@ -484,6 +484,9 @@ func (s *Server) checkAuth(r *http.Request) bool {
if s.isBearerAuthorized(r) {
return true
}
if r != nil && strings.TrimSpace(r.URL.Query().Get("token")) == strings.TrimSpace(s.token) {
return true
}
if c, err := r.Cookie("clawgo_webui_token"); err == nil && strings.TrimSpace(c.Value) == s.token {
return true
}