{"id":18375,"library":"fl-auth-server","title":"fl-auth-server","description":"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.","status":"maintenance","version":"11.7.2","language":"javascript","source_language":"en","source_url":"https://github.com/founderlab/frameworkstein#master","tags":["javascript"],"install":[{"cmd":"npm install fl-auth-server","lang":"bash","label":"npm"},{"cmd":"yarn add fl-auth-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add fl-auth-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to provide app instance for middleware and route configuration","package":"express","optional":false},{"reason":"Underlying authentication framework used by fl-auth-server","package":"passport","optional":false},{"reason":"Session middleware required when sessions are enabled","package":"express-session","optional":true}],"imports":[{"note":"ESM-only; no default export. The main function for setting up auth routes.","wrong":"const configure = require('fl-auth-server')","symbol":"configure","correct":"import { configure } from 'fl-auth-server'"},{"note":"Middleware to protect routes; requires ESM import.","wrong":"const { loggedIn } = require('fl-auth-server')","symbol":"loggedIn","correct":"import { loggedIn } from 'fl-auth-server'"},{"note":"Only if you need direct access to Passport instance; typically not needed.","wrong":"","symbol":"Passport","correct":"import { Passport } from 'fl-auth-server'"},{"note":"No default export; use named imports only.","wrong":"import { default } from 'fl-auth-server'","symbol":"default","correct":"import flAuthServer from 'fl-auth-server'"}],"quickstart":{"code":"import express from 'express';\nimport session from 'express-session';\nimport { configure } from 'fl-auth-server';\n\nconst app = express();\napp.use(session({ secret: 'keyboard cat', resave: false, saveUninitialized: true }));\n\nconfigure({\n  app,\n  facebook: {\n    clientId: process.env.FACEBOOK_CLIENT_ID ?? '',\n    clientSecret: process.env.FACEBOOK_CLIENT_SECRET ?? '',\n    url: process.env.URL ?? 'http://localhost:3000',\n    paths: {\n      redirect: '/auth/facebook',\n      callback: '/auth/facebook/callback',\n    },\n  },\n  login: {\n    usernameField: 'email',\n    passwordField: 'password',\n  },\n  sendResetEmail: async (user, resetToken) => {\n    console.log(`Reset token for ${user.email}: ${resetToken}`);\n  },\n});\n\napp.listen(3000, () => console.log('Server running on port 3000'));","lang":"typescript","description":"Shows minimal setup for fl-auth-server with Express, session middleware, Facebook OAuth, and password reset email placeholder."},"warnings":[{"fix":"Use import { configure } from 'fl-auth-server' instead of require('fl-auth-server').","message":"Import style must be ESM; CommonJS require() will not work.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Use 'linkedin' key instead of second 'facebook' when configuring LinkedIn.","message":"The facebook configuration object is documented twice in README, but the second mention is actually for LinkedIn.","severity":"gotcha","affected_versions":">=11.0.0"},{"fix":"Consider migrating to passport.js directly with latest strategies.","message":"Passport version in fl-auth-server may not be up-to-date; OAuth flows may break with modern Facebook/LinkedIn API changes.","severity":"deprecated","affected_versions":">=11.0.0"},{"fix":"Ensure app.use(session(...)) is called before configure({app, ...}).","message":"Session middleware (express-session) must be added to app before calling configure(); otherwise sessions will not work.","severity":"gotcha","affected_versions":">=11.0.0"},{"fix":"Provide a sendResetEmail callback in the options object.","message":"The sendResetEmail function is required but not passed in the example; missing it will cause an error.","severity":"breaking","affected_versions":">=11.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import { configure } from 'fl-auth-server' and ensure your project is configured for ESM.","cause":"Using CommonJS require() instead of ESM import.","error":"TypeError: fl_auth_server_1.configure is not a function"},{"fix":"Run npm install express-session and add app.use(session({...})) before configure().","cause":"express-session not installed or not required before configure() is called.","error":"Error: Cannot find module 'express-session'"},{"fix":"Set a view engine like EJS or disable views by overriding sendResetEmail to avoid template rendering.","cause":"View engine not set for reset email template; the library may try to render views.","error":"Error: No default engine was specified and no extension was provided."},{"fix":"Ensure process.env.URL matches the exact callback URL registered in Facebook App Settings.","cause":"The url option in facebook config does not match the deployed app's domain.","error":"FacebookLoginError: 'redirect_uri' is not valid"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}