fix: require >1 provider for unlink account endpoints (fixes #29)
This commit is contained in:
parent
d223cd89e8
commit
004403895a
5 changed files with 24 additions and 0 deletions
|
@ -40,6 +40,16 @@ type User struct {
|
|||
DeleteReason *string
|
||||
}
|
||||
|
||||
func (u User) NumProviders() (numProviders int) {
|
||||
if u.Discord != nil {
|
||||
numProviders++
|
||||
}
|
||||
if u.Fediverse != nil {
|
||||
numProviders++
|
||||
}
|
||||
return numProviders
|
||||
}
|
||||
|
||||
// usernames must match this regex
|
||||
var usernameRegex = regexp.MustCompile(`^[\w-.]{2,40}$`)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue