From 01848e94939c1deff0ad20287a924466729c7388 Mon Sep 17 00:00:00 2001 From: UnicodingUnicorn <7555ic@gmail.com> Date: Fri, 22 Feb 2019 23:12:48 +0800 Subject: [PATCH] Updated token to fit with backend-auth --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 2abf277..f76e9fa 100644 --- a/main.go +++ b/main.go @@ -36,8 +36,8 @@ func main() { } type LoginData struct { - ID string `json:"id"` - Client string `json:"client"` + ID string `json:"userid"` + Client string `json:"clientid"` } func Login(w http.ResponseWriter, r *http.Request, p httprouter.Params) { @@ -50,8 +50,8 @@ func Login(w http.ResponseWriter, r *http.Request, p httprouter.Params) { } token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims { - "id": login.ID, - "client": login.Client, + "userid": login.ID, + "clientid": login.Client, }) tokenString, err := token.SignedString(secret)