Even more tests, crossed 50% coverage

This commit is contained in:
2024-10-03 14:00:39 +01:00
parent 8767756431
commit 13572003a5
3 changed files with 75 additions and 6 deletions
+5 -3
View File
@@ -181,8 +181,7 @@ func (t *TraefikOidc) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if req.URL.Path == t.logoutURLPath {
t.handleLogout(rw, req)
http.Error(rw, "Logged out", http.StatusForbidden)
return
return // Remove the http.Error call here
}
if t.redirectURL == "" {
@@ -300,11 +299,14 @@ func (t *TraefikOidc) buildAuthURL(redirectURL, state, nonce string) string {
"client_id": {t.clientID},
"response_type": {"code"},
"redirect_uri": {redirectURL},
"scope": {strings.Join(t.scopes, " ")},
"state": {state},
"nonce": {nonce},
}
if len(t.scopes) > 0 {
params.Set("scope", strings.Join(t.scopes, " "))
}
return fmt.Sprintf("%s?%s", t.authURL, params.Encode())
}