middleware

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DjangoSessionCookieNotFound  string = "django session cookie not found in the incoming request"
	DjangoSessionCookieIsBlank   string = "django session cookie is blank in the incoming request"
	DjangoSessionCookieIsExpired string = "django session cookie is expired in the incoming request"
)
View Source
const (
	DjangoSessionCookie string = "sessionid"
)

Variables

View Source
var (
	UnauthorizedJson = gin.H{"error": "unauthorized"}
)

Functions

func LoginRequired

func LoginRequired(c *gin.Context)

LoginRequired uses a cookie named "sessionid", this session id is compared to the django_sessions table If the session is in the table the user is considered as authenticated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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