summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-04-26 15:10:43 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-04-26 21:10:43 +0800
commit8371f94d06cefbd65392af3b5c0f1fd1057429f7 (patch)
treed6bf49ee4406be76e5429bc70da4a5dee22e3cab /modules
parentb7da5a6cb7c725232c1053a1ca705a6ac0dad467 (diff)
downloadgitea-8371f94d06cefbd65392af3b5c0f1fd1057429f7.tar.gz
gitea-8371f94d06cefbd65392af3b5c0f1fd1057429f7.zip
Rework SSH key management UI to add GPG (#1293)
* Rework SSH key management UI to add GPG * Add more detail to gpg key display * Update CHANGELOG.md * Implement deletion UI * Implement adding gpg UI * Various fixes - Fix duplicate entry in locale - Re-generate hash before verification since they are consumed * Add missing translation * Split template * Catch not found/verified email error
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/user_form.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index 2f767d4c8c..9e19c78a45 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -163,14 +163,15 @@ func (f *AddOpenIDForm) Validate(ctx *macaron.Context, errs binding.Errors) bind
return validate(errs, ctx.Data, f, ctx.Locale)
}
-// AddSSHKeyForm form for adding SSH key
-type AddSSHKeyForm struct {
+// AddKeyForm form for adding SSH/GPG key
+type AddKeyForm struct {
+ Type string `binding:"OmitEmpty"`
Title string `binding:"Required;MaxSize(50)"`
Content string `binding:"Required"`
}
// Validate validates the fields
-func (f *AddSSHKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+func (f *AddKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}