Skip to content

Commit cdb8b21

Browse files
committed
Make sessions user like API user
1 parent 0a84f59 commit cdb8b21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

routers/kitspace.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ import (
1111
"gitea.com/macaron/csrf"
1212
"gitea.com/macaron/session"
1313

14-
"code.gitea.io/gitea/models"
1514
"code.gitea.io/gitea/modules/context"
15+
"code.gitea.io/gitea/modules/convert"
1616
"code.gitea.io/gitea/modules/setting"
17+
"code.gitea.io/gitea/modules/structs"
1718
)
1819

1920
type KitspaceSession struct {
20-
User *models.User
21+
User *structs.User
2122
Csrf string
2223
}
2324

@@ -33,7 +34,7 @@ func Kitspace(ctx *context.Context, sess session.Store, x csrf.CSRF) (int, []byt
3334
)
3435

3536
m := KitspaceSession{
36-
User: ctx.User,
37+
User: convert.ToUser(ctx.User, ctx.IsSigned, ctx.User != nil),
3738
Csrf: x.GetToken(),
3839
}
3940

0 commit comments

Comments
 (0)