1.0.10 • Published 6 years ago

mares-jwt v1.0.10

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

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()
}
1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago