24 lines
310 B
Go
Raw Normal View History

2017-06-07 21:37:13 +00:00
package utils
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
)
// GetUser ...
func GetUser(ctx *aero.Context) *arn.User {
userID := ctx.Session().GetString("userId")
if userID == "" {
return nil
}
user, err := arn.GetUser(userID)
if err != nil {
return nil
}
return user
}