1.0.8 • Published 2 years ago

jsonwebtoken-template v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

jsonwebtoken-template

Library that facilitates the use of jwt using reusable functions from Frontend with React.js

Installation

npm i jsonwebtoken-template

Usage

const useJwt = require ('jsonwebtoken-template')

# Define Object
const user = {
   name : "Andy",
   password: "Santisteban"
}
# Define time expired
const expired={
    time:"1h"
}
# Define word secret
const varEnv="secret"

# Create Token
const toker = useJwt.signJwt(user,expired,varEnv)

console.log(toker)

# Decodificed Token
const decoded = useJwt.verifyJwt(toker,varEnv)

console.log(decoded)

If you want to add it to the browser's localStorage you can use the following example

 sendTokenLocalStorage(key,token)

Si deseas agregarlo al sessionStorage del navegador puedes utilizar el siguiente ejemplo (no recomendable)

 sendTokenSessionStorage(key,token)

Version

1.0.6

Author

Andy Santisteban

License

MIT

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago