Skip to content

Commit

Permalink
move logic to more relevant function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jusshersmith committed Apr 23, 2019
1 parent 0253e15 commit 1e46141
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/auth/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@ func (o *Options) Validate() error {
msgs = append(msgs, "missing setting: required-host-header")
}

if len(o.OrgName) > 0 {
o.OrgName = strings.Trim(o.OrgName, `"`)
}
if len(o.ProviderServerID) > 0 {
o.ProviderServerID = strings.Trim(o.ProviderServerID, `"`)
}

o.redirectURL, msgs = parseURL(o.RedirectURL, "redirect", msgs)

msgs = validateEndpoints(o, msgs)
Expand Down Expand Up @@ -290,9 +297,7 @@ func newProvider(o *Options) (providers.Provider, error) {
o.GroupsCacheStopFunc = cache.Stop
singleFlightProvider = providers.NewSingleFlightProvider(googleProvider)
case providers.OktaProviderName:
orgName := strings.Trim(o.OrgName, "\"")
providerServerID := strings.Trim(o.ProviderServerID, "\"")
oktaProvider, err := providers.NewOktaProvider(p, orgName, providerServerID)
oktaProvider, err := providers.NewOktaProvider(p, o.OrgName, o.ProviderServerID)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1e46141

Please sign in to comment.