parent
782ffbbe6d
commit
d2fb0fa707
|
|
@ -50,14 +50,14 @@ func (ctx *Context) RegisterPost(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx.RedirectWithFlash(w, r, "/", "successful_registration", true)
|
ctx.RedirectWithFlash(w, r, "/", "successful_registration", true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type jsonParams struct {
|
type registerJsonParams struct {
|
||||||
Username string
|
Username string
|
||||||
NewPassword string
|
NewPassword string
|
||||||
ConfirmPassword string
|
ConfirmPassword string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *Context) RegisterPostJson(w http.ResponseWriter, r *http.Request) {
|
func (ctx *Context) RegisterPostJson(w http.ResponseWriter, r *http.Request) {
|
||||||
var params jsonParams
|
var params registerJsonParams
|
||||||
err := decodeJsonParams(r, ¶ms)
|
err := decodeJsonParams(r, ¶ms)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
writeGeneralError(w, "Failed to decode json params: "+err.Error(), http.StatusBadRequest)
|
writeGeneralError(w, "Failed to decode json params: "+err.Error(), http.StatusBadRequest)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue