Skip to content

Commit

Permalink
added comments in session constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mdslab87 committed Aug 15, 2017
1 parent ecd2aa3 commit 7bd63e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ npm install secure-jws-session
const Session = require('secure-jws-session')

const config = {
secret: '@2e£$1#1&$23_-!', // a secret key
serverHost: 'www.mdslab.org',
time: 1 // in minutes
secret: '@2e£$1#1&$23_-!', // secret key (String)
serverHost: 'www.mdslab.org', // server hostname (String)
time: 1 // Set time expiration in minutes (Int)
}

const auth = new Session(config)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "secure-jws-session",
"version": "0.1.3",
"version": "0.1.4",
"description": "Secure json web signature sessions with Redis",
"main": "index.js",
"scripts": {
"doc": "jsdoc2md --no-gfm src/session.js > api.md",
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"keywords": [
Expand Down
5 changes: 3 additions & 2 deletions src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class Session {
/**
* constructor config
* @param {string} secret a secret key used to generate the token
* @param {string} serverHost the hostname of the server
* @param {string} serverHost hostname of the server
* @param {int} time minutes of life for the token
*/
constructor(config){
this.secret = config.secret
Expand All @@ -30,7 +31,7 @@ class Session {

/**
* deleteToken description
* @param {type} token [user token]
* @param {type} token user token
*/
async deleteToken(token){
const decoded = await this.decodeToken(token)
Expand Down

0 comments on commit 7bd63e6

Please sign in to comment.