this user will now see this error since providers[1] == nil
I guess I'll make a PR to gitea at some point 🤷.
So it seems [here](https://github.com/go-gitea/gitea/blob/cb10f2767c920fdbca6fc43e71dcc4c4b8c6e0d0/templates/user/settings/security/accountlinks.tmpl#L30-L32) a list is indexed by an ID (instead of looking up by the ID).
```gotmpl
...
{{$providerData := index $.OAuth2Providers $loginSource.Name}}
<div class="flex-item-leading">
{{$providerData.IconHTML 20}}
...
```
This means you can break it by:
1. add a provider (ID 0)
- `len(providers) == 1`
2. add another provider (ID 1)
- `len(providers) == 2`
3. make a user using provider 2 (ID 1)
4. remove provider 1 (ID 0)
- `len(providers) == 1`
5. this user will now see this error since `providers[1] == nil`
I guess I'll make a PR to gitea at some point :shrug:.
1. Above message is just completely wrong (though the basic area of the problem was somewhat right).
2. Refer to [gitea #28667](https://github.com/go-gitea/gitea/issues/28667), will be fixed in 1.22.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
500 error on user settings -> security tab:
So it seems here a list is indexed by an ID (instead of looking up by the ID).
This means you can break it by:
len(providers) == 1len(providers) == 2len(providers) == 1providers[1] == nilI guess I'll make a PR to gitea at some point 🤷.