fix: return empty slice if AttributeSSHPublicKey is missing in RawData

This commit is contained in:
Maxim Slipenko 2024-12-27 11:17:27 +03:00
parent 4f92b738b5
commit 666654a5ef

View file

@ -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)