feat: add invitation code for signup feature (#2249)

* feat: add invitation code for signup feature

* feat: add invitation code for signup feature
This commit is contained in:
Yaodong Yu
2023-08-24 13:42:17 +08:00
committed by GitHub
parent a0c5eb241f
commit f5e0461cae
23 changed files with 298 additions and 280 deletions

View File

@ -124,6 +124,16 @@ func CheckUserSignup(application *Application, organization *Organization, form
}
}
if len(application.InvitationCodes) > 0 {
if form.InvitationCode == "" {
return i18n.Translate(lang, "check:Invitation code cannot be blank")
} else {
if !util.InSlice(application.InvitationCodes, form.InvitationCode) {
return i18n.Translate(lang, "check:Invitation code is invalid")
}
}
}
return ""
}