1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-10-18 07:34:22 +00:00
nginx-sso/plugins/cookie.go
Knut Ahlers 841f6458cd
Prepare moving auth plugins to own modules
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-04-21 16:58:06 +02:00

21 lines
449 B
Go

package plugins
import "github.com/gorilla/sessions"
type CookieConfig struct {
Domain string `yaml:"domain"`
AuthKey string `yaml:"authentication_key"`
Expire int `yaml:"expire"`
Prefix string `yaml:"prefix"`
Secure bool `yaml:"secure"`
}
func (c CookieConfig) GetSessionOpts() *sessions.Options {
return &sessions.Options{
Path: "/",
Domain: c.Domain,
MaxAge: c.Expire,
Secure: c.Secure,
HttpOnly: true,
}
}