From 2210b990b30a20b24e6d29d7e39490dd6487714c Mon Sep 17 00:00:00 2001 From: johanneskarrer Date: Fri, 29 Nov 2024 14:41:48 +0100 Subject: [PATCH] enforced return after abortwithstatus --- web/index.go | 1 + web/saml.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/web/index.go b/web/index.go index 394a9ac5f..bfeae1b8d 100644 --- a/web/index.go +++ b/web/index.go @@ -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 diff --git a/web/saml.go b/web/saml.go index 338894aff..bf6143751 100644 --- a/web/saml.go +++ b/web/saml.go @@ -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] } @@ -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}) })