feat: Add Invitation Code to Generate Invitation Link (#2666)

Add auto-population of invitation fields in the registration page based on the invitation code in the link
This commit is contained in:
HGZ-20
2024-02-02 21:12:56 +08:00
committed by GitHub
parent bbbda1982f
commit b7be1943fa
56 changed files with 269 additions and 27 deletions

View File

@ -184,6 +184,15 @@ func CheckInvitationCode(application *Application, organization *Organization, a
}
}
func CheckInvitationDefaultCode(code string, defaultCode string, lang string) error {
if matched, err := util.IsInvitationCodeMatch(code, defaultCode); err != nil {
return err
} else if !matched {
return fmt.Errorf(i18n.Translate(lang, "check:Default code does not match the code's matching rules"))
}
return nil
}
func checkSigninErrorTimes(user *User, lang string) error {
failedSigninLimit, failedSigninFrozenTime, err := GetFailedSigninConfigByUser(user)
if err != nil {