mirror of
https://github.com/pushbits/server.git
synced 2025-07-30 06:39:13 +02:00
Implement retrieving of user data
This commit is contained in:
parent
a3de04b2a5
commit
e4e87f2710
7 changed files with 101 additions and 73 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue