form: fix contact details/profile application when using email

confirmation

my rewrite of account-creation stuff had a massive oversight of email
confirmation, the steps done after account creation (email and contact
method storage, referral stuff) were not done on the email confirmation
path. This has been factored out to PostNewUserFromIvnite, and the
ConfirmationKeys store now includes the newUserDTO and the list of
completeContactMethods.
This commit is contained in:
Harvey Tindall
2024-10-11 16:38:19 +01:00
parent 71922212d9
commit ea57d657fe
4 changed files with 53 additions and 34 deletions
+6 -2
View File
@@ -624,7 +624,7 @@ func (app *appContext) NewUserFromConfirmationKey(invite Invite, key string, lan
"contactMessage": app.config.Section("ui").Key("contact_message").String(),
})
}
var req newUserDTO
var req ConfirmationKey
if app.ConfirmationKeys == nil {
fail()
return
@@ -666,8 +666,10 @@ func (app *appContext) NewUserFromConfirmationKey(invite Invite, key string, lan
profile = &p
}
// FIXME: Email and contract method linking?????
nu /*wg*/, _ := app.NewUserPostVerification(NewUserParams{
Req: req,
Req: req.newUserDTO,
SourceType: sourceType,
Source: source,
ContextForIPLogging: gc,
@@ -683,6 +685,8 @@ func (app *appContext) NewUserFromConfirmationKey(invite Invite, key string, lan
}
app.checkInvite(req.Code, true, req.Username)
app.PostNewUserFromInvite(nu, req, profile, invite)
jfLink := app.config.Section("ui").Key("redirect_url").String()
if app.config.Section("ui").Key("auto_redirect").MustBool(false) {
gc.Redirect(301, jfLink)