'use strict';

var jwt = require('jsonwebtoken'),
  secrets = require('../../../config/secrets');
/*
 * Verify that the decoded json web token includes the
 * user email address and that the token is verified with
 * the secret key.
 *
 */
module.exports = function(model) {
  let payload = jwt.decode(model.token);

  return model.email === payload.email
    && jwt.verify(model.token, secrets.jwt);
};

@@ -259,21 +259,20 @@
 unction(
-model
+user
 ) %7B%0A  le
@@ -294,21 +294,20 @@
 .decode(
-model
+user
 .token);
@@ -317,21 +317,20 @@
  return 
-model
+user
 .email =
@@ -368,13 +368,12 @@
 ify(
-model
+user
 .tok

rename model to user in valid jwt matcher