summaryrefslogtreecommitdiffstats
path: root/routers/user/profile.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r--routers/user/profile.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index 03f88e256a..675c1dc3f4 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -59,9 +59,16 @@ func Profile(ctx *context.Context) {
isShowKeys := false
if strings.HasSuffix(uname, ".keys") {
isShowKeys = true
+ uname = strings.TrimSuffix(uname, ".keys")
}
- ctxUser := GetUserByName(ctx, strings.TrimSuffix(uname, ".keys"))
+ isShowGPG := false
+ if strings.HasSuffix(uname, ".gpg") {
+ isShowGPG = true
+ uname = strings.TrimSuffix(uname, ".gpg")
+ }
+
+ ctxUser := GetUserByName(ctx, uname)
if ctx.Written() {
return
}
@@ -72,6 +79,12 @@ func Profile(ctx *context.Context) {
return
}
+ // Show GPG keys.
+ if isShowGPG {
+ ShowGPGKeys(ctx, ctxUser.ID)
+ return
+ }
+
if ctxUser.IsOrganization() {
showOrgProfile(ctx)
return