mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
feat(auth): allow JWT IP changes by configuration (#1236)
* feat(auth): allow JWT IP changes by configuration * fix(auth): make JWT IP change setting concurrency-safe * test(auth): move JWT IP change setting tests out of MCP test file
This commit is contained in:
1 parent
8cb86e3853
commit
d19952a834
8 files changed
+172
-2
No files matched your search
@@ -152,7 +152,7 @@ func identityHandler() func(c *gin.Context) any {
|
||||
return nil
|
||||
}
|
||||
currentIP := c.GetString(model.CtxKeyRealIPStr)
|
||||
if sess.IP != currentIP {
|
||||
if !singleton.Conf.JWTIPChangeAllowed() && sess.IP != currentIP {
|
||||
c.Set(model.CtxKeyIsIPMismatch, true)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user