Skip to content

Commit 0589544

Browse files
adnaanclaude
andcommitted
fix(auth): clear LiveTemplate session on password login
After setting the auth session cookie, we need to clear the LiveTemplate session cookie to force the home page to fetch fresh state. Without this, the cached IsLoggedIn=false state persists and the home page shows the login button instead of logout after successful login. This matches the behavior in HandleLogout which already clears the LiveTemplate session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f93e7e1 commit 0589544

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/kits/system/multi/templates/auth/handler.go.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,9 @@ func (c *{{.StructName}}Controller) HandlePasswordLogin(w http.ResponseWriter, r
651651
// Set session cookie (30 days) - Secure flag is auto-detected from request
652652
cookie.SetSession(w, r, "{{.TableName}}_token", tok, 30)
653653

654+
// Clear LiveTemplate session cookie to force fresh state on home page
655+
cookie.ClearLiveTemplateSession(w)
656+
654657
// Redirect to home
655658
http.Redirect(w, r, "/", http.StatusSeeOther)
656659
}

0 commit comments

Comments
 (0)