Beispiel #1
0
// FromContext retrieves the auth.Context from the session.
func FromContext(ctx *martian.Context) *Context {
	if v, ok := ctx.Session().Get(key); ok {
		return v.(*Context)
	}

	actx := &Context{}
	ctx.Session().Set(key, actx)

	return actx
}