File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,15 @@ func Security(ctx *context.Context) {
34
34
35
35
// DeleteAccountLink delete a single account link
36
36
func DeleteAccountLink (ctx * context.Context ) {
37
- if _ , err := models .RemoveAccountLink (ctx .User , ctx .QueryInt64 ("loginSourceID" )); err != nil {
38
- ctx .Flash .Error ("RemoveAccountLink: " + err .Error ())
37
+ id := ctx .QueryInt64 ("id" )
38
+ if id <= 0 {
39
+ ctx .Flash .Error ("Account link id is not given" )
39
40
} else {
40
- ctx .Flash .Success (ctx .Tr ("settings.remove_account_link_success" ))
41
+ if _ , err := models .RemoveAccountLink (ctx .User , id ); err != nil {
42
+ ctx .Flash .Error ("RemoveAccountLink: " + err .Error ())
43
+ } else {
44
+ ctx .Flash .Success (ctx .Tr ("settings.remove_account_link_success" ))
45
+ }
41
46
}
42
47
43
48
ctx .JSON (200 , map [string ]interface {}{
You can’t perform that action at this time.
0 commit comments