mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 21:01:17 +00:00
22 lines
449 B
Go
22 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,
|
||
|
}
|
||
|
}
|