New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mares-jwt

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mares-jwt

express.js 미들웨어를 이용하여 jwt 암호화, 복호화를 해주는 모듈입니다.

latest
npmnpm
Version
1.0.10
Version published
Maintainers
6
Created
Source

mares-jwt

슬로그업 ddd에서 presentaion layer 에서 jwt token 을 암호화,복호화 하는 모듈입니다.

Installation

npm install --save mares-jwt

Example

//register middleware
const app = require('express')
const maresJwt = require('mares-jwt')

//토큰의 위치, 토큰 이름, 만료시간, 시크릿값
app.use(maresJwt.binder(location, 'tokenName', 'expiresIn', 'secret'))

const middle = (req, res , next) => {
	// 암호화
	const payload = {
		_id: 1
	}
	const token = req.sign(payload)
	
	// 복호화
	const decodeJwt = req.verify()
	next()
}

Keywords

슬로그업

FAQs

Package last updated on 13 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts