Skip to content

Commit e378545

Browse files
authored
Filter inactive auth sources (#27870)
Fix nil access for inactive auth sources. > Render failed, failed to render template: user/settings/security/security, error: template error: builtin(static):user/settings/security/accountlinks:32:20 : executing "user/settings/security/accountlinks" at <$providerData.IconHTML>: nil pointer evaluating oauth2.Provider.IconHTML Code tries to access the auth source of an `ExternalLoginUser` but the list contains only the active auth sources.
1 parent 9b6e77c commit e378545

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/user/setting/security/security.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func loadSecurityData(ctx *context.Context) {
8282
// map the provider display name with the AuthSource
8383
sources := make(map[*auth_model.Source]string)
8484
for _, externalAccount := range accountLinks {
85-
if authSource, err := auth_model.GetSourceByID(ctx, externalAccount.LoginSourceID); err == nil {
85+
if authSource, err := auth_model.GetSourceByID(ctx, externalAccount.LoginSourceID); err == nil && authSource.IsActive {
8686
var providerDisplayName string
8787

8888
type DisplayNamed interface {

0 commit comments

Comments
 (0)