From a617d52374e937db0edacfba2a26bdd14a05538e Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 6 Apr 2017 00:14:30 -0400 Subject: 2fa: initial support (#945) --- pkg/context/context.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/context/context.go') diff --git a/pkg/context/context.go b/pkg/context/context.go index 4213eaa4..40d7c8c7 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -89,6 +89,11 @@ func (c *Context) Success(name string) { c.HTML(http.StatusOK, name) } +// JSONSuccess responses JSON with status http.StatusOK. +func (c *Context) JSONSuccess(data interface{}) { + c.JSON(http.StatusOK, data) +} + // RenderWithErr used for page has form validation but need to prompt error to users. func (ctx *Context) RenderWithErr(msg, tpl string, f interface{}) { if f != nil { -- cgit v1.2.3