Skip to content

JWT middleware: support for accessing token from cookie #589

@Komosa

Description

@Komosa

In addition to providing JWT by simple header or URL parameter there will be good to have possibility to get token from cookie.

As a bonus, it will be good to extend JWTConfig with HandleEmptyToken field of type echo.HandlerFunc - it will provide way to redirect to login page; other kinds of errors (as invalid token) should be handled without changes. Nil value should cause old behavior (400 - Bad Request).
This bonus will be backward compatible.

I will be glad to implement this myself and submit PR, but it is always good to ask for comments before doing so.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions