authifyjs
v1.0.0
Published
Integrate authentication easily
Downloads
5
Readme
Authifyjs
Introduction
A Social Auth boilerplate exposing routes and middleware for Facebook and classic password auth.
Include authentication in a jiffy!
Installation
Install packages:
$ yarn
In your Express JS App, include the following code:
import Authify from 'authifyjs';
const {
AUTH_JWT_SECRET,
AUTH_JWT_ISSUER,
AUTH_JWT_AUDIENCE,
AUTH_JWT_EXPIRY,
FACEBOOK_CLIENT_ID,
FACEBOOK_CLIENT_SECRET
} = process.env;
// Exposes authify routes
Authify.init({
mongoUri: process.env.MONGO_URI,
app,
opts: {
useClassic: true,
useFacebook: true,
facebook: {
clientId: FACEBOOK_CLIENT_ID,
clientSecret: FACEBOOK_CLIENT_SECRET
}
},
jwt: {
secret: AUTH_JWT_SECRET,
issuer: AUTH_JWT_ISSUER,
audience: AUTH_JWT_AUDIENCE,
expiry: AUTH_JWT_EXPIRY
}
});