Implement retrieving of user data

This commit is contained in:
eikendev 2020-08-04 18:42:03 +02:00
parent a3de04b2a5
commit e4e87f2710
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
7 changed files with 101 additions and 73 deletions

View file

@ -24,6 +24,7 @@ func GetUser(ctx *gin.Context) *model.User {
user, ok := ctx.MustGet("user").(*model.User)
if user == nil || !ok {
ctx.AbortWithError(http.StatusInternalServerError, errors.New("an error occured while retrieving user from context"))
return nil
}
return user