mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Make sure people don't create duplicate Fever usernames
This commit is contained in:
parent
9eb91e6f0b
commit
038ea790f7
4 changed files with 27 additions and 5 deletions
|
@ -62,6 +62,12 @@ func (c *Controller) UpdateIntegration(ctx *core.Context, request *core.Request,
|
|||
integrationForm := form.NewIntegrationForm(request.Request())
|
||||
integrationForm.Merge(integration)
|
||||
|
||||
if integration.FeverUsername != "" && c.store.HasDuplicateFeverUsername(user.ID, integration.FeverUsername) {
|
||||
ctx.SetFlashErrorMessage(ctx.Translate("There is already someone else with the same Fever username!"))
|
||||
response.Redirect(ctx.Route("integrations"))
|
||||
return
|
||||
}
|
||||
|
||||
if integration.FeverEnabled {
|
||||
integration.FeverToken = fmt.Sprintf("%x", md5.Sum([]byte(integration.FeverUsername+":"+integration.FeverPassword)))
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue