Initialise Session Storage in NewOAuthProxy instead of validation

This commit is contained in:
Joel Speed
2020-06-28 12:32:06 +01:00
parent c8dbf1cf60
commit 5ce9e75c21
7 changed files with 141 additions and 70 deletions
-8
View File
@@ -21,7 +21,6 @@ import (
"github.com/oauth2-proxy/oauth2-proxy/pkg/ip"
"github.com/oauth2-proxy/oauth2-proxy/pkg/logger"
"github.com/oauth2-proxy/oauth2-proxy/pkg/requests"
"github.com/oauth2-proxy/oauth2-proxy/pkg/sessions"
"github.com/oauth2-proxy/oauth2-proxy/providers"
)
@@ -210,13 +209,6 @@ func Validate(o *options.Options) error {
}
msgs = parseProviderInfo(o, msgs)
sessionStore, err := sessions.NewSessionStore(&o.Session, &o.Cookie)
if err != nil {
msgs = append(msgs, fmt.Sprintf("error initialising session storage: %v", err))
} else {
o.SetSessionStore(sessionStore)
}
if o.Cookie.Refresh >= o.Cookie.Expire {
msgs = append(msgs, fmt.Sprintf(
"cookie_refresh (%s) must be less than "+