UNPKG

0uth

Version:

![GitHub](https://img.shields.io/github/license/Mantra27/0uth) ![npm](https://img.shields.io/npm/v/0uth) ![Node.js](https://img.shields.io/node/v/0uth) ![GitHub last commit](https://img.shields.io/github/last-commit/Mantra27/0uth)

13 lines (12 loc) 537 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const passport = require("passport"); module.exports = (config, req, res, next) => { if (String(config.client).toLocaleLowerCase() == "local") { return passport.authenticate('local', { failureRedirect: '/login' }), function (req, res, next) { res.redirect('/local/callback'); }(req, res, next); } passport.authenticate(config.client, { scope: config.scope, failWithError: true })(req, res, next); };