MCPcopy Create free account
hub / github.com/gogs/gogs / DeleteSSHKey

Function DeleteSSHKey

internal/route/user/setting.go:378–388  ·  view source on GitHub ↗
(c *context.Context)

Source from the content-addressed store, hash-verified

376}
377
378func DeleteSSHKey(c *context.Context) {
379 if err := database.DeletePublicKey(c.User, c.QueryInt64("id")); err != nil {
380 c.Flash.Error("DeletePublicKey: " + err.Error())
381 } else {
382 c.Flash.Success(c.Tr("settings.ssh_key_deletion_success"))
383 }
384
385 c.JSONSuccess(map[string]any{
386 "redirect": conf.Server.Subpath + "/user/settings/ssh",
387 })
388}
389
390func SettingsSecurity(c *context.Context) {
391 c.Title("settings.security")

Callers

nothing calls this directly

Calls 5

DeletePublicKeyFunction · 0.92
SuccessMethod · 0.80
TrMethod · 0.80
JSONSuccessMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected