Skip to content

Commit

Permalink
#61 add oauth config to BasicTest
Browse files Browse the repository at this point in the history
  • Loading branch information
bnfinet committed Jan 29, 2019
1 parent b866c53 commit f16e534
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cfg/cfg.go
Expand Up @@ -225,6 +225,18 @@ func BasicTest() error {
return fmt.Errorf("configuration error: either one of %s or %s needs to be set (but not both)", Branding.LCName+".domains", Branding.LCName+".allowAllUsers")
}

// OAuthconfig Checks
switch {
case GenOAuth.ClientID == "":
return errors.New("configuration error: oauth.client_id not found")
// case GenOAuth.Provider != Providers.IndieAuth && GenOAuth.ClientSecret == "":
// return errors.New("configuration error: oauth.client_secret not found")
case GenOAuth.AuthURL == "":
return errors.New("configuration error: oauth.auth_url not found")
case GenOAuth.UserInfoURL == "":
return errors.New("configuration error: oauth.user_info_url not found")
}

if !viper.IsSet(Branding.LCName + ".allowAllUsers") {
if GenOAuth.RedirectURL != "" {
if err := checkCallbackConfig(GenOAuth.RedirectURL); err != nil {
Expand Down

0 comments on commit f16e534

Please sign in to comment.