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)

18 lines (13 loc) 533 B
//@ts-ignore import passport from "passport" import { OAuthConfig } from "../../Interface/config"; const CallbackHandler = (config: OAuthConfig, req:any, res:any) => { //@ts-ignore const callBack = (string:any) => { //we're not handling string parameter rn //@ts-ignore return res.redirect(`${String(config.success_redirect)}`) }; passport.authenticate(config.client, { failureRedirect: config.failure_redirect })(req, res, (error:any) => callBack(error)) }; module.exports = CallbackHandler;