Skip to content

Commit

Permalink
enforced return after abortwithstatus (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
karjo24 authored Dec 2, 2024
1 parent 039523d commit d3a11f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (d *IndexData) LoadLivestreams(c *gin.Context, daoWrapper dao.DaoWrapper) {
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
logger.Error("could not get current live streams", "err", err)
c.AbortWithStatusJSON(http.StatusNotFound, gin.H{"message": "Could not load current livestream from database."})
return
}

tumLiveContext := d.TUMLiveContext
Expand Down
2 changes: 2 additions & 0 deletions web/saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func configSaml(r *gin.Engine, daoWrapper dao.DaoWrapper) {
if len(s) == 0 || s[0] == "" {
logger.Error("Can't extract mwn id", "LRZ-ID", lrzID, "firstName", firstName, "lastName", lastName, "mwnID", matrNr)
c.AbortWithStatus(http.StatusInternalServerError)
return
}
matrNr = s[0]
}
Expand All @@ -145,6 +146,7 @@ func configSaml(r *gin.Engine, daoWrapper dao.DaoWrapper) {
if err != nil {
logger.Error("Could not upsert user", "err", err)
c.AbortWithStatus(http.StatusInternalServerError)
return
}
HandleValidLogin(c, &tools.SessionData{Userid: user.ID, SamlSubjectID: &subjectID})
})
Expand Down

0 comments on commit d3a11f6

Please sign in to comment.