fl-auth-server

raw JSON →
11.7.2 verified Sat Apr 25 auth: no javascript maintenance

Server-side authentication package for FounderLab apps, version 11.7.2. Provides Express-based login, registration, logout, password reset, and OAuth (Facebook, LinkedIn) strategies using Passport.js. It is part of a proprietary suite with no public release history or cadence. Differentiators include automatic route generation, support for custom User models, and integrated session management via express-session. The library is not actively maintained on GitHub. Alternatives include passport.js directly or NextAuth.js for more modern setups.

error TypeError: fl_auth_server_1.configure is not a function
cause Using CommonJS require() instead of ESM import.
fix
Change to import { configure } from 'fl-auth-server' and ensure your project is configured for ESM.
error Error: Cannot find module 'express-session'
cause express-session not installed or not required before configure() is called.
fix
Run npm install express-session and add app.use(session({...})) before configure().
error Error: No default engine was specified and no extension was provided.
cause View engine not set for reset email template; the library may try to render views.
fix
Set a view engine like EJS or disable views by overriding sendResetEmail to avoid template rendering.
error FacebookLoginError: 'redirect_uri' is not valid
cause The url option in facebook config does not match the deployed app's domain.
fix
Ensure process.env.URL matches the exact callback URL registered in Facebook App Settings.
breaking Import style must be ESM; CommonJS require() will not work.
fix Use import { configure } from 'fl-auth-server' instead of require('fl-auth-server').
gotcha The facebook configuration object is documented twice in README, but the second mention is actually for LinkedIn.
fix Use 'linkedin' key instead of second 'facebook' when configuring LinkedIn.
deprecated Passport version in fl-auth-server may not be up-to-date; OAuth flows may break with modern Facebook/LinkedIn API changes.
fix Consider migrating to passport.js directly with latest strategies.
gotcha Session middleware (express-session) must be added to app before calling configure(); otherwise sessions will not work.
fix Ensure app.use(session(...)) is called before configure({app, ...}).
breaking The sendResetEmail function is required but not passed in the example; missing it will cause an error.
fix Provide a sendResetEmail callback in the options object.
npm install fl-auth-server
yarn add fl-auth-server
pnpm add fl-auth-server

Shows minimal setup for fl-auth-server with Express, session middleware, Facebook OAuth, and password reset email placeholder.

import express from 'express';
import session from 'express-session';
import { configure } from 'fl-auth-server';

const app = express();
app.use(session({ secret: 'keyboard cat', resave: false, saveUninitialized: true }));

configure({
  app,
  facebook: {
    clientId: process.env.FACEBOOK_CLIENT_ID ?? '',
    clientSecret: process.env.FACEBOOK_CLIENT_SECRET ?? '',
    url: process.env.URL ?? 'http://localhost:3000',
    paths: {
      redirect: '/auth/facebook',
      callback: '/auth/facebook/callback',
    },
  },
  login: {
    usernameField: 'email',
    passwordField: 'password',
  },
  sendResetEmail: async (user, resetToken) => {
    console.log(`Reset token for ${user.email}: ${resetToken}`);
  },
});

app.listen(3000, () => console.log('Server running on port 3000'));