优化报销管理增加挂靠
This commit is contained in:
1 parent
7b1c94b5ff
commit
ee49ef15b5
24 files changed
+1267
-70
No files matched your search
@@ -368,17 +368,17 @@ func authorizePath(c *AuthOidcController) string {
|
||||
return "/auth/authorize"
|
||||
}
|
||||
|
||||
// clearSessionCookie 清除认证中心会话 Cookie
|
||||
// clearSessionCookie 清除认证中心会话 Cookie。
|
||||
// 与写入复用同一实现:http 环境写入的 Cookie 不带 Secure,若清除时硬编码
|
||||
// Secure,浏览器会拒绝删除,失效的 yz_sid 一直残留,authorize 每次都判定
|
||||
// 未登录并把用户送回登录页。
|
||||
func clearSessionCookie(c *AuthOidcController) {
|
||||
c.Ctx.Output.Header("Set-Cookie",
|
||||
fmt.Sprintf("%s=; Path=/; Max-Age=0; HttpOnly; Secure; SameSite=Lax", sessionCookieName))
|
||||
clearSessionCookieForCtx(c.Ctx)
|
||||
}
|
||||
|
||||
// setSessionCookie 写入认证中心会话 Cookie
|
||||
func setSessionCookie(c *AuthOidcController, sid string) {
|
||||
c.Ctx.Output.Header("Set-Cookie",
|
||||
fmt.Sprintf("%s=%s; Path=/; Max-Age=%d; HttpOnly; Secure; SameSite=Lax",
|
||||
sessionCookieName, sid, sessionCookieTTL))
|
||||
setSessionCookieForCtx(c.Ctx, sid)
|
||||
}
|
||||
|
||||
func bearerToken(c *AuthOidcController) string {
|
||||
@@ -526,7 +526,10 @@ func exchangeCode(code, verifier, clientID string) (*authsvc.TokenPair, *jwtutil
|
||||
Filter("code_hash", stored.CodeHash).
|
||||
Update(map[string]interface{}{"used": 1})
|
||||
|
||||
session, err := authsvc.CreateSession(authsvc.SessionInfo{
|
||||
// 复用登录阶段建立的会话,切勿在此新建:新建会话会触发「1 号 1 机」
|
||||
// 互踢,把浏览器 yz_sid Cookie 对应的会话吊销,导致下一次回认证中心
|
||||
// 又看到登录页(登录成功后反复跳回登录界面)。
|
||||
session, err := authsvc.ReuseSession(authsvc.SessionInfo{
|
||||
IdentityID: stored.IdentityID,
|
||||
Tid: stored.Tid,
|
||||
ClientID: clientID,
|
||||
|
||||
Reference in new issue
Block a user