Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
refreshToken := jwt.New(jwt.SigningMethodHS256)
rtClaims := refreshToken.Claims.(jwt.MapClaims)
rtClaims["sub"] = 1
rtClaims["exp"] = time.Now().Add(time.Hour * 24).Unix()
rt, err := refreshToken.SignedString([]byte("secret"))
if err != nil {
return err
return c.JSON(http.StatusOK, map[string]string{
"access_token": t,
"refresh_token": rt,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment