mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-05-06 05:38:50 +00:00
fix: 恢复被误删的 AuthCodeURL 调用,修复编译失败
上次提交误删了 url := o2conf.AuthCodeURL(...) 导致编译失败。 同时添加注释说明 Cookie Secure 属性动态设置的原因。 Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -65,6 +65,8 @@ func oauth2redirect(c *gin.Context) (*model.Oauth2LoginResponse, error) {
|
||||
RedirectURL: redirectURL,
|
||||
}, cache.DefaultExpiration)
|
||||
|
||||
url := o2conf.AuthCodeURL(state, oauth2.AccessTypeOnline)
|
||||
// CodeQL go/cookie-secure-not-set: 根据请求协议动态设置 Secure 属性,避免 HTTP 环境下 Cookie 无法使用
|
||||
c.SetCookie("nz-o2s", stateKey, 60*5, "", "", c.Request.URL.Scheme == "https" || c.Request.TLS != nil, false)
|
||||
|
||||
return &model.Oauth2LoginResponse{Redirect: url}, nil
|
||||
|
||||
Reference in New Issue
Block a user