mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-12-15 04:08:19 +08:00
Backport #36117 by @schinkelg Changed a small typo in an English error message and code comments. Very small PR. Co-authored-by: Ger Schinkel <schinkelg@users.noreply.github.com>
This commit is contained in:
@@ -118,7 +118,7 @@ func (c *csrfProtector) PrepareForSessionUser(ctx *Context) {
|
||||
if uidChanged {
|
||||
_ = ctx.Session.Set(c.opt.oldSessionKey, c.id)
|
||||
} else if cookieToken != "" {
|
||||
// If cookie token presents, re-use existing unexpired token, else generate a new one.
|
||||
// If cookie token present, re-use existing unexpired token, else generate a new one.
|
||||
if issueTime, ok := ParseCsrfToken(cookieToken); ok {
|
||||
dur := time.Since(issueTime) // issueTime is not a monotonic-clock, the server time may change a lot to an early time.
|
||||
if dur >= -CsrfTokenRegenerationInterval && dur <= CsrfTokenRegenerationInterval {
|
||||
|
||||
Reference in New Issue
Block a user