mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-12-27 18:42:30 +00:00
feat: refresh session cookie when session is active (#540)
* feat: refresh session cookie when session is active * refactor: use current time to set new expiry
This commit is contained in:
@@ -66,6 +66,7 @@ func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
|
||||
goto basic
|
||||
}
|
||||
|
||||
m.auth.RefreshSessionCookie(c)
|
||||
c.Set("context", &config.UserContext{
|
||||
Username: cookie.Username,
|
||||
Name: cookie.Name,
|
||||
@@ -90,6 +91,7 @@ func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
|
||||
goto basic
|
||||
}
|
||||
|
||||
m.auth.RefreshSessionCookie(c)
|
||||
c.Set("context", &config.UserContext{
|
||||
Username: cookie.Username,
|
||||
Name: cookie.Name,
|
||||
|
||||
Reference in New Issue
Block a user