Skip to content

Commit

Permalink
#62 #61 make auth_url check provider aware
Browse files Browse the repository at this point in the history
  • Loading branch information
bnfinet committed Jan 29, 2019
1 parent 30a6aec commit 22772be
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/cfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,16 @@ func BasicTest() error {
// OAuthconfig Checks
switch {
case GenOAuth.ClientID == "":
// everyone has a 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 == "":
case GenOAuth.Provider != Providers.IndieAuth && GenOAuth.ClientSecret == "":
// everyone except IndieAuth has a clientSecret
return errors.New("configuration error: o`auth.client_secret not found")
case GenOAuth.Provider != Providers.Google && GenOAuth.AuthURL == "":
// everyone except IndieAuth and Google has an authURL
return errors.New("configuration error: oauth.auth_url not found")
case GenOAuth.UserInfoURL == "":
case GenOAuth.Provider != Providers.Google && GenOAuth.Provider != Providers.IndieAuth && GenOAuth.UserInfoURL == "":
// everyone except IndieAuth and Google has an userInfoURL
return errors.New("configuration error: oauth.user_info_url not found")
}

Expand Down

0 comments on commit 22772be

Please sign in to comment.