mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Fix a lint warning.
This commit is contained in:
parent
ffa527340a
commit
b8844fb1e2
|
|
@ -35,7 +35,7 @@ type oidcIdentityProvider struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func newOIDCIdentityProvider(cfg *config.IdentityProvider, hc *http.Client) (*oidcIdentityProvider, error) {
|
func newOIDCIdentityProvider(cfg *config.IdentityProvider, hc *http.Client) *oidcIdentityProvider {
|
||||||
return &oidcIdentityProvider{
|
return &oidcIdentityProvider{
|
||||||
oauth2IdentityProvider: &oauth2IdentityProvider{
|
oauth2IdentityProvider: &oauth2IdentityProvider{
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
|
|
@ -48,7 +48,7 @@ func newOIDCIdentityProvider(cfg *config.IdentityProvider, hc *http.Client) (*oi
|
||||||
displayNamePath: "name",
|
displayNamePath: "name",
|
||||||
suggestedUserIDPath: "preferred_username",
|
suggestedUserIDPath: "preferred_username",
|
||||||
},
|
},
|
||||||
}, nil
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *oidcIdentityProvider) AuthorizationURL(ctx context.Context, callbackURL, nonce string) (string, error) {
|
func (p *oidcIdentityProvider) AuthorizationURL(ctx context.Context, callbackURL, nonce string) (string, error) {
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,7 @@ func NewAuthenticator(ctx context.Context, cfg *config.SSO) (*Authenticator, err
|
||||||
|
|
||||||
switch pcfg.Type {
|
switch pcfg.Type {
|
||||||
case config.SSOTypeOIDC:
|
case config.SSOTypeOIDC:
|
||||||
p, err := newOIDCIdentityProvider(&pcfg, hc)
|
a.providers[pcfg.ID] = newOIDCIdentityProvider(&pcfg, hc)
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("failed to create OpenID Connect provider %q: %w", pcfg.ID, err)
|
|
||||||
}
|
|
||||||
a.providers[pcfg.ID] = p
|
|
||||||
case config.SSOTypeGitHub:
|
case config.SSOTypeGitHub:
|
||||||
a.providers[pcfg.ID] = newGitHubIdentityProvider(&pcfg, hc)
|
a.providers[pcfg.ID] = newGitHubIdentityProvider(&pcfg, hc)
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue