{"size": 299, "ext": "js", "max_stars_repo_path": "utils/jwt.js", "max_stars_repo_name": "sagar608/nodejs-jwt-authentication-crud-api", "max_stars_repo_stars_event_min_datetime": "2020-10-05T16:33:27.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-22T13:44:42.000Z", "max_issues_repo_path": "utils/jwt.js", "max_issues_repo_name": "sagar608/nodejs-jwt-authentication-crud-api", "max_issues_repo_issues_event_min_datetime": "2021-09-02T12:33:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T12:33:59.000Z", "max_forks_repo_path": "utils/jwt.js", "max_forks_repo_name": "sagar608/nodejs-jwt-authentication-crud-api", "max_forks_repo_forks_event_min_datetime": "2021-05-02T08:29:58.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-06T00:05:39.000Z"}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 21.3571428571, "max_line_length": 56, "alphanum_fraction": 0.6923076923}
const jwt = require('jsonwebtoken')

const jwtSecret = process.env.JWT_SECRET || 'secretkey'

const createToken = payload => {
  return jwt.sign(payload, jwtSecret)
}

const verifyToken = token => {
  return jwt.verify(token, jwtSecret)
}

module.exports = { createToken, verifyToken }
