5
0
Fork 0

Updated token to fit with backend-auth

feat/improved-bypass
UnicodingUnicorn 2019-02-22 23:12:48 +08:00
parent e82b4b400e
commit 01848e9493
1 changed files with 4 additions and 4 deletions

View File

@ -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)