summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-10-11 21:04:42 -0400
committerUnknwon <joe2010xtmf@163.com>2014-10-11 21:04:42 -0400
commit452ccff81ca736a07bec44a059a0562a08656bf4 (patch)
tree15487dbe076319793515a34586991753a2ef34cd /routers/user
parentfb839ca0fb998f2dfdd280e959f85a576bb7742b (diff)
downloadgitea-452ccff81ca736a07bec44a059a0562a08656bf4.tar.gz
gitea-452ccff81ca736a07bec44a059a0562a08656bf4.zip
Mirror fix on add ssh key
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 8f778acd0d..778f27ac50 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -177,9 +177,13 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
cleanContent := strings.Replace(form.Content, "\n", "", -1)
if ok, err := models.CheckPublicKeyString(cleanContent); !ok {
- ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))
- ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
- return
+ if err == models.ErrKeyUnableVerify {
+ ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key"))
+ } else {
+ ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))
+ ctx.Redirect(setting.AppSubUrl + "/user/settings/ssh")
+ return
+ }
}
k := &models.PublicKey{