How to use the depd function in depd

To help you get started, we’ve selected a few depd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stone-payments / node-global-identity / lib / express-middleware.js View on Github external
import depd from 'depd';

const deprecate = depd('node-global-identity');

export default function isAuthenticated(globalIdentity) {
  deprecate('isAuthenticated(gi): Use gi.isAuthenticated() instead');

  return (req, res, next) => {
    if (!req.headers.authorization) {
      return res.status(401).json({ error: { message: 'Invalid token' } });
    }

    const [authType, token] = req.headers.authorization.split(' ');

    if (!authType || !token) {
      return res.status(401).json({ error: { message: 'Invalid token' } });
    }

    return globalIdentity.validateToken(token).then((result) => {

depd

Deprecate all the things

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis

Popular depd functions