mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-30 06:09:26 +01:00
fix bug when deleting a linked account will removed all (#5989)
This commit is contained in:
parent
9dfdf80af0
commit
06a1739553
1 changed files with 8 additions and 3 deletions
|
@ -34,10 +34,15 @@ 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")
|
||||||
ctx.Flash.Error("RemoveAccountLink: " + err.Error())
|
if id <= 0 {
|
||||||
|
ctx.Flash.Error("Account link id is not given")
|
||||||
} else {
|
} 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{}{
|
ctx.JSON(200, map[string]interface{}{
|
||||||
|
|
Loading…
Reference in a new issue