Updated token to fit with backend-auth
parent
e82b4b400e
commit
01848e9493
8
main.go
8
main.go
|
@ -36,8 +36,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
type LoginData struct {
|
type LoginData struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"userid"`
|
||||||
Client string `json:"client"`
|
Client string `json:"clientid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func Login(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
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 {
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims {
|
||||||
"id": login.ID,
|
"userid": login.ID,
|
||||||
"client": login.Client,
|
"clientid": login.Client,
|
||||||
})
|
})
|
||||||
|
|
||||||
tokenString, err := token.SignedString(secret)
|
tokenString, err := token.SignedString(secret)
|
||||||
|
|
Loading…
Reference in New Issue