diff options
author | zeripath <art27@cantab.net> | 2020-03-28 17:24:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 19:24:55 +0200 |
commit | ea67e563dd9fc20e508d41079ea00312b880ac82 (patch) | |
tree | 0e66a5157866ae99f84995f7478fc6c05d2dd26d /routers | |
parent | f9f2c163b12f60a6bf9c3652cdc4bdf59e3d53c4 (diff) | |
download | gitea-ea67e563dd9fc20e508d41079ea00312b880ac82.tar.gz gitea-ea67e563dd9fc20e508d41079ea00312b880ac82.zip |
Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863)
* Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen
Fix #3985
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Pass up the unable to verify
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/setting/keys.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/user/setting/keys.go b/routers/user/setting/keys.go index 3475299437..73ae73da40 100644 --- a/routers/user/setting/keys.go +++ b/routers/user/setting/keys.go @@ -92,6 +92,9 @@ func KeysPost(ctx *context.Context, form auth.AddKeyForm) { ctx.Data["Err_Title"] = true ctx.RenderWithErr(ctx.Tr("settings.ssh_key_name_used"), tplSettingsKeys, &form) + case models.IsErrKeyUnableVerify(err): + ctx.Flash.Info(ctx.Tr("form.unable_verify_ssh_key")) + ctx.Redirect(setting.AppSubURL + "/user/settings/keys") default: ctx.ServerError("AddPublicKey", err) } |