Only filter out failing openid providers if multiple are configured and one of them failed
This commit is contained in:
parent
b76ad8efe2
commit
20ede346b4
1 changed files with 7 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
||||||
package openid
|
package openid
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"code.vikunja.io/api/pkg/log"
|
||||||
"context"
|
"context"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -48,7 +49,11 @@ func GetAllProviders() (providers []*Provider, err error) {
|
||||||
|
|
||||||
provider, err := getProviderFromMap(pi)
|
provider, err := getProviderFromMap(pi)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
if provider != nil {
|
||||||
|
log.Errorf("Error while getting openid provider %s: %s", provider.Name, err)
|
||||||
|
}
|
||||||
|
log.Errorf("Error while getting openid provider: %s", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
providers = append(providers, provider)
|
providers = append(providers, provider)
|
||||||
|
@ -119,7 +124,7 @@ func getProviderFromMap(pi map[interface{}]interface{}) (*Provider, error) {
|
||||||
var err error
|
var err error
|
||||||
provider.OpenIDProvider, err = oidc.NewProvider(context.Background(), provider.AuthURL)
|
provider.OpenIDProvider, err = oidc.NewProvider(context.Background(), provider.AuthURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return provider, err
|
||||||
}
|
}
|
||||||
|
|
||||||
provider.Oauth2Config = &oauth2.Config{
|
provider.Oauth2Config = &oauth2.Config{
|
||||||
|
|
Loading…
Reference in a new issue