package
1.1.1
Repository: https://github.com/headwindfly/clevergo.git
Documentation: pkg.go.dev

# README

CSRF (Cross Site Request Forgery) Protection Middleware

This middleware requires CleverGo CSRF and CleverGo Session Middleware.

This session middleware is necessary.

Install dependences

go get github.com/clevergo/sessions
go get github.com/clevergo/csrf

About the usages of sessions package, please refer to https://github.com/clevergo/sessions.

About the usages of csrf package, please refer to https://github.com/clevergo/csrf.

Example

CSRF Protection Example

go run $GOPATH/src/github.com/headwindfly/clevergo/examples/csrf/main.go

Usage

Please refer to JSON WEB TOKEN Example.

Set Error Handler

CSRFMiddleware.SetErrorHandler(handler clevergo.HandlerFunc)

# Functions

NewCSRFMiddleware returns CSRF Middleware instance.

# Structs

CSRFMiddleware Cross Site Request Forgery Protection Middleware.