Skip to content

Commit

Permalink
make sure user is signed in
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Humphreys <[email protected]>
  • Loading branch information
Mjaethers committed Apr 23, 2024
1 parent 1ad3ca8 commit 6eb602b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion api/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,15 @@ func (r usersRoutes) updateSeekingTime(c *gin.Context) {
}

func (r usersRoutes) updateAutoSkip(c *gin.Context) {
u := getUserFromContext(c)
u := c.MustGet("TUMLiveContext").(tools.TUMLiveContext).User
if u == nil {
_ = c.Error(tools.RequestError{
Status: http.StatusUnauthorized,
CustomMessage: "login required for updating user settings",
})
return
}

var req struct{ Value model.AutoSkipSetting }
if err := c.BindJSON(&req); err != nil {
_ = c.Error(tools.RequestError{
Expand Down

0 comments on commit 6eb602b

Please sign in to comment.