Skip to content
Snippets Groups Projects
Commit 6955a5d4 authored by Christian Pointner's avatar Christian Pointner
Browse files

gin bindings are actually not that nice

parent fc0d382f
No related branches found
No related tags found
Loading
......@@ -25,6 +25,7 @@
package auth
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
......@@ -82,7 +83,7 @@ func Init(c *Config, infoLog, errLog, dbgLog *log.Logger) (err error) {
func newSession() gin.HandlerFunc {
return func(c *gin.Context) {
request := &NewSessionRequest{}
err := c.ShouldBindJSON(&request)
err := json.NewDecoder(c.Request.Body).Decode(request)
if err != nil {
c.JSON(http.StatusBadRequest, HTTPErrorResponse{"Error decoding request: " + err.Error()})
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment