1.0.10 • Published 5 years ago

mares-jwt v1.0.10

Weekly downloads
1
License
ISC
Repository
-
Last release
5 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

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago