Skip to content

sivakrishnacode/authj-npm-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuthJ

The Authentication System to generate a jwt securly in Express.js

Make sure You are conf the 'secret-key' with .env

Installation

Use the package manager npm to install authj.

npm i authj

Usage

const useAuthj = require('authj')

const authj = useAuthj()

authj.config('secret-key')

# For sign the key
authj. signToken({ username: "username", password: "password",userDetails: {}, isAuth: false })
.then((res) => {
      console.log(res);
     })
.catch((err) => {
      console.log(err);
     })


# For Check the token is valid or not
authj.checkToken({token : 'token'})
.then((res) => {
      console.log(res);
     })
.catch((err) => {
      console.log(err);
     })



# For Extract the value from token 
authj. getTokenInfo({token: 'token'})
.then((res) => {
      console.log(res);
     })
.catch((err) => {
      console.log(err);
     })

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author

Sivakrishna sivakrishnacoc@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published