Skip to content

Commit 4f0afbe

Browse files
committed
fix: Better error message when trying to logout without keys
Today if we don't configure id_token_jwk_url we got: {"error":"Cannot get the keys","error_description":{"Op":"Get","URL":"","Err":{}}} So let's make the error more explicit
1 parent 16756bf commit 4f0afbe

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

web/oidc/oidc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,13 @@ func Logout(c echo.Context) error {
538538
})
539539
}
540540

541+
if conf.IDTokenKeyURL == "" {
542+
return c.JSON(http.StatusBadRequest, echo.Map{
543+
"error": "Cannot get the keys",
544+
"error_description": "id_token_jwk_url is not configured",
545+
})
546+
}
547+
541548
keys, err := GetIDTokenKeys(conf.IDTokenKeyURL)
542549
if err != nil {
543550
return c.JSON(http.StatusBadRequest, echo.Map{

0 commit comments

Comments
 (0)