![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
express-account-pages
Advanced tools
An abstraction middleware for Express for user management on top of Passport
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.
Requires JQuery and Bootstrap 4 (JS + CSS) on the client side.
|
|
|
|
Nucleus | ElioPay | Backery | Lttrfeed |
👋 Want to be listed there? Contact me.
// 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',
// disableSignup: true,
// 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("my_account_view", { // Where account is your page structure
accountTemplate: require.resolve("express-account-pages/account.ejs")
})
})
Make sure to have Bootstrap.js and jQuery included. 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
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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.