Example #1
0
func restricted(c vodka.Context) error {
	user := c.Get("user").(*jwt.Token)
	claims := user.Claims.(jwt.MapClaims)
	name := claims["name"].(string)
	return c.String(http.StatusOK, "Welcome "+name+"!")
}
Example #2
0
// shortcut to get session
func Default(c *vodka.Context) Session {
	return c.Get(DefaultKey).(Session)
}