![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
express-account-pages
Advanced tools
npm i express-account-pages
A simple to use module for Express that handles authentification (signup and login) and provide a basic account page you can place in your app.
Based on JQuery and Bootstrap.
// Init express
const express = require('express')
const app = express()
// Add your DB
const mongoose = require('mongoose')
const mongoURI = process.env.MONGO_URL || 'mongodb://localhost:27017/myappdb'
mongoose.connect(mongoURI, { useNewUrlParser: true })
// Your db schmeas
const db = require('./helpers/db')
// Parse from html forms and post payload
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
// For signup and login
require('express-account-pages')(app, {
siteName: 'My Web App',
primaryColor: '#b90577',
// background: 'red',
// logoUrl: '/favicon.png',
mongoose: mongoose,
useAccessToken: true, // Access token management
redirectLogin: '/account',
redirectSignup: '/account',
// signupMailExtra: 'You can now create your first app.',
mongoUser: db.User,
connectors: {
github: {
clientId: "xxxxxxx",
clientSecret: "xxxxxx",
redirectUri: "https://my.app/auth/github/callback"
},
google: {
clientId: 'xxxxxxx.apps.googleusercontent.com',
clientSecret: 'xxxxxxxxx',
redirectUri: 'https://my.app/auth/google/callback'
}
}
})
Will require Bootstrap and jQuery.
In your express route:
app.get("/account", (req, res, next) => {
res.render("myaccountpage", { // Where account is your page structure
accountTemplate: require.resolve("express-account-pages/account.ejs")
})
})
Then, in your ejs:
<body>
<%- include(accountTemplate) %>
</body>
<script src="/account/account.js" defer></script>
Currently the module supports Github and Google oauth.
The redirect URIs are predefined paths:
FAQs
An abstraction middleware for Express for user management on top of Passport
The npm package express-account-pages receives a total of 1 weekly downloads. As such, express-account-pages popularity was classified as not popular.
We found that express-account-pages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.