fix(session): session id generator situational panic (#2471)

* fix(session): replace session id generator
This replaces the fasthttp session generator with a more generic one.
pull/2466/head
James Elliott 2021-10-08 12:34:43 +11:00 committed by GitHub
parent b606ec6752
commit f3c2539e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ import (
func NewProviderConfig(configuration schema.SessionConfiguration, certPool *x509.CertPool) ProviderConfig { func NewProviderConfig(configuration schema.SessionConfiguration, certPool *x509.CertPool) ProviderConfig {
config := session.NewDefaultConfig() config := session.NewDefaultConfig()
config.SessionIDGeneratorFunc = func() []byte {
return []byte(utils.RandomString(30, utils.AlphaNumericCharacters))
}
// Override the cookie name. // Override the cookie name.
config.CookieName = configuration.Name config.CookieName = configuration.Name