Skip to content

Split JWT middleware #25

@Alma-media

Description

@Alma-media

use JWT middleware and validators separately
Example:

  • validator
type Validator interface {
	Validate(string, interface{}) error // interface is Claims object
}
  • middleware
func JWT(validator Validator, cf func() Claims) Middleware {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions