mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-01-09 16:45:43 +00:00
fix: return empty slice if AttributeSSHPublicKey is missing in RawData
This commit is contained in:
parent
4f92b738b5
commit
666654a5ef
1 changed files with 1 additions and 1 deletions
|
@ -1188,7 +1188,7 @@ func getSSHKeys(source *oauth2.Source, gothUser *goth.User) ([]string, error) {
|
||||||
key := source.AttributeSSHPublicKey
|
key := source.AttributeSSHPublicKey
|
||||||
value, exists := gothUser.RawData[key]
|
value, exists := gothUser.RawData[key]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, fmt.Errorf("attribute '%s' not found in user data", key)
|
return []string{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
rawSlice, ok := value.([]any)
|
rawSlice, ok := value.([]any)
|
||||||
|
|
Loading…
Reference in a new issue