summaryrefslogtreecommitdiffstats
path: root/routers/user/setting/security_u2f.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/setting/security_u2f.go')
-rw-r--r--routers/user/setting/security_u2f.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/routers/user/setting/security_u2f.go b/routers/user/setting/security_u2f.go
index c1d6eab967..b733467b84 100644
--- a/routers/user/setting/security_u2f.go
+++ b/routers/user/setting/security_u2f.go
@@ -42,7 +42,11 @@ func U2FRegister(ctx *context.Context, form auth.U2FRegistrationForm) {
return
}
}
- ctx.Session.Set("u2fName", form.Name)
+ err = ctx.Session.Set("u2fName", form.Name)
+ if err != nil {
+ ctx.ServerError("", err)
+ return
+ }
ctx.JSON(200, u2f.NewWebRegisterRequest(challenge, regs.ToRegistrations()))
}
@@ -95,5 +99,4 @@ func U2FDelete(ctx *context.Context, form auth.U2FDeleteForm) {
ctx.JSON(200, map[string]interface{}{
"redirect": setting.AppSubURL + "/user/settings/security",
})
- return
}