feat(oidc): return defined error when discovery failed (#653)
* feat(oidc): return defined error when discovery failed * Use errors.Join() to join errors Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com> * Remove unnecessary field Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com> * Fix order and message Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com> * Fix error order * Simplify error assertion Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com> --------- Co-authored-by: Tim Möhlmann <muhlemmer@gmail.com>
This commit is contained in:
parent
b555396744
commit
3b64e792ed
3 changed files with 13 additions and 8 deletions
|
@ -42,7 +42,7 @@ func Discover(ctx context.Context, issuer string, httpClient *http.Client, wellK
|
|||
discoveryConfig := new(oidc.DiscoveryConfiguration)
|
||||
err = httphelper.HttpRequest(httpClient, req, &discoveryConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Join(oidc.ErrDiscoveryFailed, err)
|
||||
}
|
||||
if logger, ok := logging.FromContext(ctx); ok {
|
||||
logger.Debug("discover", "config", discoveryConfig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue