Fix connection through Kerberos
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
nemunaire 2022-09-07 20:54:04 +02:00
parent b572938283
commit 60540a1631
2 changed files with 30 additions and 22 deletions

View file

@ -80,5 +80,10 @@ func checkAuthKrb5(c *gin.Context) {
return
}
completeAuth(c, lf.Login, lf.Login+"@epita.fr", "", "", "", nil)
if usr, err := completeAuth(c, lf.Login, lf.Login+"@epita.fr", "", "", "", nil); err != nil {
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"errmsg": err.Error()})
return
} else {
c.JSON(http.StatusOK, authToken{User: usr, CurrentPromo: currentPromo})
}
}