middleware

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JWTHandler = jwtmiddleware.New(jwtmiddleware.Config{
		ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
			return []byte(config.Conf.Auth.Secret), nil
		},
		SigningMethod: jwt.SigningMethodHS256,
		ErrorHandler: func(ctx iris.Context, s string) {
			ctx.StatusCode(iris.StatusUnauthorized)
			if _, err := ctx.JSON(response.Response{
				Code:    iris.StatusUnauthorized,
				Message: "Unauthenticated.",
				Data:    make(map[string]interface{}),
			}); err != nil {
				log.Println(err)
			}
		},
	})
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL