Skip to content

middleware: Failure on init causes panic until process restart #51

Description

@lstoll

We use a once block to set up the OIDC client in the middleware:

var initErr error
h.oidcClientInit.Do(func() {
h.oidcClient, initErr = oidc.DiscoverClient(ctx, h.Issuer, h.ClientID, h.ClientSecret, h.RedirectURL)
})
if initErr != nil {
return nil, initErr
}

If the discovery fails, this will return an error and never attempt to initialise the client again. We should always try and initialise until we have a functioning client.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions