Commit 06a17395 authored by Lunny Xiao's avatar Lunny Xiao Committed by techknowlogick
Browse files

fix bug when deleting a linked account will removed all (#5989)

Showing with 8 additions and 3 deletions
+8 -3
......@@ -34,10 +34,15 @@ func Security(ctx *context.Context) {
// DeleteAccountLink delete a single account link
func DeleteAccountLink(ctx *context.Context) {
if _, err := models.RemoveAccountLink(ctx.User, ctx.QueryInt64("loginSourceID")); err != nil {
ctx.Flash.Error("RemoveAccountLink: " + err.Error())
id := ctx.QueryInt64("id")
if id <= 0 {
ctx.Flash.Error("Account link id is not given")
} else {
ctx.Flash.Success(ctx.Tr("settings.remove_account_link_success"))
if _, err := models.RemoveAccountLink(ctx.User, id); err != nil {
ctx.Flash.Error("RemoveAccountLink: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("settings.remove_account_link_success"))
}
}
ctx.JSON(200, map[string]interface{}{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment