fix empty/missing logouturl leads to error, add description to config.yml.sample

This commit is contained in:
viehlieb 2022-12-08 14:55:05 +01:00
parent 6e36288ba7
commit 49f02dee87
2 changed files with 9 additions and 1 deletions

View File

@ -311,6 +311,9 @@ auth:
- name:
# The auth url to send users to if they want to authenticate using OpenID Connect.
authurl:
# The oidc logouturl that users will be redirected to on logout
# leave empty or delete key, if you do not want to be redirected
logouturl:
# The client ID used to authenticate Vikunja at the OpenID Connect provider.
clientid:
# The client secret used to authenticate Vikunja at the OpenID Connect provider.

View File

@ -120,13 +120,18 @@ func getProviderFromMap(pi map[string]interface{}) (provider *Provider, err erro
k := getKeyFromName(name)
logoutUrl, ok := pi["logout_url"].(string)
if !ok {
logoutUrl = ""
}
provider = &Provider{
Name: pi["name"].(string),
Key: k,
AuthURL: pi["authurl"].(string),
OriginalAuthURL: pi["authurl"].(string),
ClientSecret: pi["clientsecret"].(string),
LogoutURL: pi["logouturl"].(string),
LogoutURL: logoutUrl,
}
cl, is := pi["clientid"].(int)