Skip to content

Commit f859d7a

Browse files
committed
only use cookie for non-signed-in user
1 parent dae1a61 commit f859d7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/web/misc/webtheme.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ func WebThemeList(ctx *context.Context) {
3333

3434
func WebThemeApply(ctx *context.Context) {
3535
themeName := ctx.FormString("theme")
36-
middleware.SetSiteCookie(ctx.Resp, "gitea_theme", themeName, 0)
3736
if ctx.Doer != nil {
3837
opts := &user_service.UpdateOptions{Theme: optional.Some(themeName)}
3938
_ = user_service.UpdateUser(ctx, ctx.Doer, opts)
39+
} else {
40+
middleware.SetSiteCookie(ctx.Resp, "gitea_theme", themeName, 0)
4041
}
4142
}

0 commit comments

Comments
 (0)