Handle GrizzlyFlix signup mail and Seerr sync failures
This commit is contained in:
+25
-17
@@ -189,32 +189,40 @@ func (app *appContext) NewUserFromInvite(gc *gin.Context) {
|
||||
respond(500, "errorUnknown", gc)
|
||||
return
|
||||
}
|
||||
if app.ConfirmationKeys == nil {
|
||||
app.ConfirmationKeys = map[string]map[string]ConfirmationKey{}
|
||||
}
|
||||
cKeys, ok := app.ConfirmationKeys[req.Code]
|
||||
if !ok {
|
||||
cKeys = map[string]ConfirmationKey{}
|
||||
}
|
||||
cKeys[key] = ConfirmationKey{
|
||||
newUserDTO: req,
|
||||
completeContactMethods: completeContactMethods,
|
||||
}
|
||||
app.confirmationKeysLock.Lock()
|
||||
app.ConfirmationKeys[req.Code] = cKeys
|
||||
app.confirmationKeysLock.Unlock()
|
||||
|
||||
app.debug.Printf(lm.EmailConfirmationRequired, req.Username)
|
||||
respond(401, "confirmEmail", gc)
|
||||
msg, err := app.email.constructConfirmation(req.Code, req.Username, key, false)
|
||||
if err != nil {
|
||||
app.err.Printf(lm.FailedConstructConfirmationEmail, req.Code, err)
|
||||
respond(500, "errorUnknown", gc)
|
||||
return
|
||||
} else if err := app.email.send(msg, req.Email); err != nil {
|
||||
app.err.Printf(lm.FailedSendConfirmationEmail, req.Code, req.Email, err)
|
||||
if !app.config.Section("email_confirmation").Key("allow_account_creation_on_send_failure").MustBool(false) {
|
||||
respond(500, "errorUnknown", gc)
|
||||
return
|
||||
}
|
||||
app.debug.Printf("Email confirmation send failed for \"%s\"; continuing account creation because email_confirmation.allow_account_creation_on_send_failure is enabled", req.Username)
|
||||
} else {
|
||||
app.debug.Printf(lm.SentConfirmationEmail, req.Code, req.Email)
|
||||
if app.ConfirmationKeys == nil {
|
||||
app.ConfirmationKeys = map[string]map[string]ConfirmationKey{}
|
||||
}
|
||||
cKeys, ok := app.ConfirmationKeys[req.Code]
|
||||
if !ok {
|
||||
cKeys = map[string]ConfirmationKey{}
|
||||
}
|
||||
cKeys[key] = ConfirmationKey{
|
||||
newUserDTO: req,
|
||||
completeContactMethods: completeContactMethods,
|
||||
}
|
||||
app.confirmationKeysLock.Lock()
|
||||
app.ConfirmationKeys[req.Code] = cKeys
|
||||
app.confirmationKeysLock.Unlock()
|
||||
|
||||
app.debug.Printf(lm.EmailConfirmationRequired, req.Username)
|
||||
respond(401, "confirmEmail", gc)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user