How to use grant-express - 2 common examples

To help you get started, we’ve selected a few grant-express 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 elmadev / elmaonline-site / src / server.js View on Github external
// Register Node.js middleware
// -----------------------------------------------------------------------------
app.use(express.static(path.resolve(__dirname, 'public')));
app.use(cookieParser());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(cors());
app.use(fileUpload());

//
// Authentication
// -----------------------------------------------------------------------------

app.use(session({ secret: 'grant' }));
app.use(
  grant({
    ...config.grant,
  }),
);

if (__DEV__) {
  app.enable('trust proxy');
}

app.post('/token', async (req, res) => {
  const authResponse = await auth(req.body);
  res.json({ Response: authResponse });
});

//
// Events API
//--------------------------------------------
github RocketChat / Rocket.Chat / packages / rocketchat-grant / server / index.js View on Github external
Meteor.startup(() => {
	const config = generateConfig();

	grant = new Grant(config);
});

grant-express

Grant OAuth Proxy middleware for Express

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis

Popular grant-express functions