|
|
@ -34,11 +34,16 @@ func Security(ctx *context.Context) { |
|
|
|
|
|
|
|
|
|
|
|
// DeleteAccountLink delete a single account link
|
|
|
|
// DeleteAccountLink delete a single account link
|
|
|
|
func DeleteAccountLink(ctx *context.Context) { |
|
|
|
func DeleteAccountLink(ctx *context.Context) { |
|
|
|
if _, err := models.RemoveAccountLink(ctx.User, ctx.QueryInt64("loginSourceID")); err != nil { |
|
|
|
id := ctx.QueryInt64("id") |
|
|
|
|
|
|
|
if id <= 0 { |
|
|
|
|
|
|
|
ctx.Flash.Error("Account link id is not given") |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if _, err := models.RemoveAccountLink(ctx.User, id); err != nil { |
|
|
|
ctx.Flash.Error("RemoveAccountLink: " + err.Error()) |
|
|
|
ctx.Flash.Error("RemoveAccountLink: " + err.Error()) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ctx.Flash.Success(ctx.Tr("settings.remove_account_link_success")) |
|
|
|
ctx.Flash.Success(ctx.Tr("settings.remove_account_link_success")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ctx.JSON(200, map[string]interface{}{ |
|
|
|
ctx.JSON(200, map[string]interface{}{ |
|
|
|
"redirect": setting.AppSubURL + "/user/settings/security", |
|
|
|
"redirect": setting.AppSubURL + "/user/settings/security", |
|
|
|