jwt generate token
const genToken = (id) => {
return JWT.sign({ id }, process.env.JWT_SECRET)
}
jwt generate token
const genToken = (id) => {
return JWT.sign({ id }, process.env.JWT_SECRET)
}
jwt encode
jwt.encode( { 'client_id':'value', 'expires_in':'datetime'}, SECRET_KEY, algorithm='HS256' )
OBS:
Convert datetime to string because in the backend is a json encode system
and it will generate a TypeError
ex: TypeError: Object of type datetime is not JSON serializable
jwt decode
jwt.decode( token, SECRET_KEY, algorithm='HS256' )
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us