RegisterAuthentication registers the user id, user and or token.
(ctx *gin.Context, user *model.User, userID uint, tokenID string)
| 7 | |
| 8 | // RegisterAuthentication registers the user id, user and or token. |
| 9 | func RegisterAuthentication(ctx *gin.Context, user *model.User, userID uint, tokenID string) { |
| 10 | ctx.Set("user", user) |
| 11 | ctx.Set("userid", userID) |
| 12 | ctx.Set("tokenid", tokenID) |
| 13 | } |
| 14 | |
| 15 | // GetUserID returns the user id which was previously registered by RegisterAuthentication. |
| 16 | func GetUserID(ctx *gin.Context) uint { |
no outgoing calls
searching dependent graphs…