mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 17:07:44 -05:00
Chi can chain middleware in one line, #fancy
This commit is contained in:
parent
4c4d95448b
commit
2d088c1f3a
1 changed files with 1 additions and 2 deletions
|
|
@ -31,8 +31,7 @@ func init() {
|
||||||
func TestSimple(t *testing.T) {
|
func TestSimple(t *testing.T) {
|
||||||
r := chi.NewRouter()
|
r := chi.NewRouter()
|
||||||
|
|
||||||
r.Use(TokenAuth.Verifier)
|
r.Use(TokenAuth.Verifier, jwtauth.Authenticator)
|
||||||
r.Use(jwtauth.Authenticator)
|
|
||||||
|
|
||||||
r.Get("/", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
r.Get("/", func(ctx context.Context, w http.ResponseWriter, r *http.Request) {
|
||||||
w.Write([]byte("welcome"))
|
w.Write([]byte("welcome"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue