From 666654a5efc42db67a836fa1c8833d944de49056 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Fri, 27 Dec 2024 11:17:27 +0300 Subject: [PATCH] fix: return empty slice if AttributeSSHPublicKey is missing in RawData --- routers/web/auth/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index 4d8fbcb7a5..62b7b0b6d3 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -1188,7 +1188,7 @@ func getSSHKeys(source *oauth2.Source, gothUser *goth.User) ([]string, error) { key := source.AttributeSSHPublicKey value, exists := gothUser.RawData[key] if !exists { - return nil, fmt.Errorf("attribute '%s' not found in user data", key) + return []string{}, nil } rawSlice, ok := value.([]any)