jsjavascriptnodejscsshtmlnode-jsexpresshtml5websiteexpressjsexpress-jsdockercss3webdevwebdevelopmentejsesmwebweb-devproject-templaterepository-templaterepository-templates
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lint
Details
Reviewed-on: #122 |
19 hours ago | |
---|---|---|
.github | 1 week ago | |
.vscode | 1 month ago | |
src | 3 weeks ago | |
tools | 1 month ago | |
.dockerignore | 3 months ago | |
.editorconfig | 2 months ago | |
.env.example | 1 month ago | |
.eslintrc.json | 3 months ago | |
.gitattributes | 3 months ago | |
.gitignore | 2 months ago | |
.htmlhintrc | 2 months ago | |
Dockerfile | 3 months ago | |
LICENSE.md | 2 months ago | |
Makefile | 3 months ago | |
README.md | 2 months ago | |
package-lock.json | 19 hours ago | |
package.json | 19 hours ago | |
renovate.json | 3 months ago |
README.md
A template for Express + EJS application with user accounts.
Screenshots
Screenshots



Notes/Warnings
- Because of how 2FA is implemented, any route that does not require authentication will not be protected by 2FA. (Homepage for example should have no user data on it because you are not fully logged in. Make another route for
/app
or whatever that requires authentication.) - Pick and choose which Social Sign In methods you want to use. Don't overwhelm the user by turning all of them on.
Features
- Social Sign In
- Registration (w/ Forced Email Verification)
- Login/Logout
- Forgot Password (Email Reset Link)
- Edit Profile
- Change Username
- Change Password
- Change Email (Email Confirmation to Old Address to Prevent Hijacking)
- Change Profile Picture
- Enable/Disable 2FA (Optional for Users, Forced for Admins)
- Delete Account
- Request/Revoke API Key(s)
- Admin Panel
- List of Accounts
- Change User's Username
- Reset User's Profile Picture
- Ban/Unban User (Does not let them login)
- Force Disable 2FA
- Delete Account
- Revoke API Key(s)
- Detach Social Account (User turns into a Local Account, and must reset their password.)
- View History of a User's Actions
- List of Accounts
- Basic Terms of Service and Privacy Policy
- Report Content Form
- API (Swagger)
git clone https://git.chse.dev/chase/express-useraccounts.git
cd express-useraccounts
npm install
cp .env.example .env
# Edit .env to your liking
node .
Social Sign In Setup
Social Sign In Setup
In these guides, baseUrl
refers to the entire URL of accessing your website. (Example: https://example.com
)
- Follow the Setting up OAuth 2.0 Google Documentation.
- When configuring the OAuth consent screen, ensure you have the scopes
email
, andprofile
. - When configuring the Credentials, for authorized JavaScript origins, put the
baseUrl
. - When configuring the Credentials, for authorized redirect URIs, put the
baseUrl/login/google/callback
.
Microsoft
- Follow the Setting up OAuth 2.0 Microsoft Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/microsoft/callback
.
GitHub
- Follow the Setting up OAuth 2.0 GitHub Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/github/callback
.
GitLab
- Follow the Setting up OAuth 2.0 GitLab Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/gitlab/callback
.
Bitbucket
- Follow the Setting up OAuth 2.0 Bitbucket Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/bitbucket/callback
.
- Follow the Setting up OAuth 2.0 Facebook Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/facebook/callback
.
- Follow the Setting up OAuth 2.0 Twitter Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/twitter/callback
.
Twitch
- Follow the Setting up OAuth 2.0 Twitch Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/twitch/callback
.
Steam
- Get an API Key from Steam.
Spotify
- Follow the Setting up OAuth 2.0 Spotify Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/spotify/callback
.
Last.fm
- Follow the Setting up OAuth 2.0 Last.fm Documentation.
- When configuring the Redirect URI, put the
baseUrl/login/lastfm/callback
.
Staff Roles
Staff Roles
Admin (Staff=2)
- Full Access
Generic Staff (Staff=1)
- Can Access Admin Panel, with restrictions.
- Cannot see Users History.
- Users Emails are redacted.
- Cannot remove 2FA from users using their recovery key.
- Cannot delete accounts.
- Cannot revoke API Keys.
- Cannot change a user's linked Last.fm account.