diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/user/email.go | 1 | ||||
-rw-r--r-- | routers/user/setting.go | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/routers/api/v1/user/email.go b/routers/api/v1/user/email.go index f42fc11cf6..0d83aa38c1 100644 --- a/routers/api/v1/user/email.go +++ b/routers/api/v1/user/email.go @@ -73,6 +73,7 @@ func DeleteEmail(ctx *context.APIContext, form api.CreateEmailOption) { for i := range form.Emails { emails[i] = &models.EmailAddress{ Email: form.Emails[i], + UID: ctx.User.ID, } } diff --git a/routers/user/setting.go b/routers/user/setting.go index 1d405fba37..bbb4d99c02 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -287,7 +287,7 @@ func SettingsEmailPost(ctx *context.Context, form auth.AddEmailForm) { // DeleteEmail response for delete user's email func DeleteEmail(ctx *context.Context) { - if err := models.DeleteEmailAddress(&models.EmailAddress{ID: ctx.QueryInt64("id")}); err != nil { + if err := models.DeleteEmailAddress(&models.EmailAddress{ID: ctx.QueryInt64("id"), UID: ctx.User.ID}); err != nil { ctx.Handle(500, "DeleteEmail", err) return } @@ -422,7 +422,7 @@ func SettingsApplicationsPost(ctx *context.Context, form auth.NewAccessTokenForm // SettingsDeleteApplication response for delete user access token func SettingsDeleteApplication(ctx *context.Context) { - if err := models.DeleteAccessTokenByID(ctx.QueryInt64("id")); err != nil { + if err := models.DeleteAccessTokenByID(ctx.QueryInt64("id"), ctx.User.ID); err != nil { ctx.Flash.Error("DeleteAccessTokenByID: " + err.Error()) } else { ctx.Flash.Success(ctx.Tr("settings.delete_token_success")) |