node-auth-rest-server
Advanced tools
Comparing version 0.1.1 to 0.1.2
'use strict'; | ||
var express = require('express'); | ||
var bcrypt = require('bcrypt-nodejs'); | ||
@@ -11,3 +10,2 @@ var bodyParser = require('body-parser'); | ||
var router = express.Router(); | ||
app.post('/api/sessions/get_auth_token', getAuthToken); | ||
@@ -43,3 +41,3 @@ | ||
authRestMethods.userByEmail(email, function(err, user){ | ||
if (err) throw err; | ||
if (err) return next(err); | ||
if(!user || !bcrypt.compareSync(password, user.password_digest)){ | ||
@@ -59,3 +57,3 @@ | ||
issueAuthToken(user, function(err, authToken){ | ||
if (err) throw err; | ||
if (err) return next(err); | ||
res.json({token: authToken.key, expires: authToken.expires_at}); | ||
@@ -62,0 +60,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "Provides a basic token authentication, and auto generation of authentication token", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4854
90