// Authorize will enforce a logged in user (if current_user_id in Context.Session())
Authorize will enforce a logged in user (if current_user_id in Context.Session())
// Authorize will enforce a logged in user ( if current_user_id in Context . Session () )
func Authorize(next buffalo.Handler) buffalo.Handler {
	return func(c buffalo.Context) error {
		if uid := c.Session().Get("current_user_id"); uid == nil {
			c.Flash().Add("danger", "You must be authorized to see that page")
			return c.Redirect(302, "/")
		}
		return next(c)
	}
}
func Authorize ( next buffalo . Handler ) buffalo . Handler { return func ( c buffalo . Context ) error { if uid := c . Session ( ) . Get ( " " ) ; uid == nil { c . Flash ( ) . Add ( " " , " " ) return c . Redirect ( 302 , " " ) } return next ( c ) } }
Authorize will enforce a logged in user (if current_user_id in Context.Session())
Authorize will enforce a logged in user ( if current_user_id in Context . Session () )