You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9d234d5
Browse filesBrowse the repository at this point in the historyBrowse files
docs: source homepage and Casbin examples from runnable files (#461)
* docs: source homepage and Casbin examples from runnable files
* docs: define Casbin enforcer on page and keep hero code out of tab order
- Include the enforcer setup from cookbook/casbin/server.go so the JWT and
Basic Auth excerpts no longer reference an undefined `ce`; exit when the
enforcer fails to load instead of continuing with a nil enforcer.
- List echo-jwt and golang-jwt in Dependencies for all locales.
- Strip Shiki's tabindex from the hero <pre>: the code window is aria-hidden,
so a focusable child fails axe aria-hidden-focus.
e.Use(NewCasbinMiddleware(ce, jwtUser)) // Casbin does authorization
194
-
195
-
e.GET("/*", func(c *echo.Context) error {
196
-
return c.String(http.StatusOK, "Hello, World!")
197
-
})
198
-
199
-
iferr:= e.Start(":8080"); err != nil {
200
-
e.Logger.Error("failed to start server", "error", err)
201
-
}
202
-
}
203
-
```
107
+
Ejecuta el [ejemplo completo de Casbin + JWT](https://github.com/labstack/echox/tree/master/cookbook/casbin) con los archivos de modelo y política anteriores.
0 commit comments