- ✨ if
security.passwordResetRateLimit
is set, password reset request are rate limited per username/email and the correct username/email must be included in the password reset requests - 🐛 sporadic session creation errors are fixed
- ✨ if
security.loginRateLimit
is set, login requests are rate limited per username/email
- 🐛 Emails are now also lowercased when logging in
- 🐛 Entries in
_users
are only deleted by the session logic if they were created bycouchAuth
- ✨ If
local.keepEmailConfirmToken
is set, email confirmation also returns a200
after the initial confirmation.- This is useful for users of mail providers like Office365 which follow links before the user can click on them.
- Instead of being redirected to the error page, they'll be redirected to the success page.
- A new view and property for
lastEmailToken
is introduced.
- 🐛 Emails are now also lowercased when requesting a password reset
- Adds config option
security.forwardErrors
to propagate expressjs errors
- 🐛 Fixes a TypeError in session cleanup
- 💥
createSession
now expects a parameter object instead of a list of parameters. - ✨
security.sessionConfig
allows to have different session lengths depending on the requestedsessionType
and the user'sroles
, e.g.:
sessionConfig: {
default: {
lifetime: 30 * 60, // 30 minutes
includedRoles: ['user'],
},
extended: {
lifetime: 60 * 60 * 24 * 14, // 14 days
includedRoles: ['user', 'support'],
excludedRolePrefixes: ['dangerous_superadmin'],
},
},
- Add
config.security.forwardErrors
to usenext(err)
instead of sending a response - Log a rare error that can occur if devs mess around with docs in
sl-users
- Bump
passport
and other dependencies
- Reject with
{status: 401, message: 'invalid token'}
instead of just a string inconfirmSession
- 💥 Email templates now use Nunjucks instead of EJS
- A
confirmEmailChange
in addition toconfirmEmail
is now required, the fallback toconfirmEmail
was removed. req
is available in all mails sent out by couch-auth- Support for
pool
when passing SMTP config
- A
- ✨ Simplified template management with base HTML templates + some markdown features. Look into
templates/email
and the REAMDE to see how it works.- TLDR: you need a
base.njk
which includes a block like this:
{% block content %} {% for paragraph in paragraphs %} <p>{{paragraph | safe}}</p> {% endfor %} {% endblock %}
- TLDR: you need a
- 🥅 add option for exponential backoff if sending a mail failed
- 🐛
logout-others
is added toactivityLog
and event emitter- 🚧 document the currently used session, when available
- ⚡ Session keys for each user are documented in
inactiveSessions
and re-used if available when logging in
- 🐛 Fix password auth with special characters
- ✨ Add support for partinioned databases
- 🔒 Update
follow-redirects
- Core API optionally accepts a
ServerScope
as second argument, but no longer the auth- and user-DB.- This way, you can still use IAM by passing the
couchServer
returned by@cloudant/cloudant
tosuperlogin-next
passport
is now the 3rd optional argument.
- This way, you can still use IAM by passing the
- Uses
nano
instead of@cloudant/cloudant
to connect with CouchDB
login
will only return a generic response if the email is not yet verified.- renamed a few methods of the API, e.g.
unlink
tounlinkSocial
- dependency updates, docs and better usage within TypeScript projects
- OAuth works again now
user_uid
is added to entries in_users
- DB- All types are emmitted now
✨ Introduced handling of consents
This allows to optionally specifiy consents with minVersion
, currentVersion
and required
in the config.
- On signup, it is verified whether all
required
consents are accepted with a valid version. - Retrieve current consents via
GET /consents
- Update via
POST /consents
-> It's not possible to revokerequired
consents or to update unsupported versions
auth/register
returned OK even if there are validation errors other than an existing email.
An optional config entry was required to successfully launch the server.
The schema for the database IDs has been migrated to UUIDs, these changes to sl-user
- doc schema must be manually migrated:
- previous
_id
insl-users
is now the fieldkey
- no more PII in document or DB-IDs: a uuid is used for the personal DBs and as
_id
insl-users
Further changes to the sl-users
:
- IP addresses are no longer saved in the
sl-users
docs lockedUntil
has been removedactivityLog
keys have slightly modified and match the emitted events, check theUserAction
-type insrc/types/typings.d.ts
.- if
emailUsername
is active, a randomkey
is generated instead of being extracted from the email
Changes to the API:
change-email
now resolves with200: change requested
-superlogin.emitter
must be used to listen to events, e.g.superlogin.emitter.on('signup', () => {..})
instead of listening directly onsuperlogin
.- added
request-deletion
- route (enabled by default).
No external session cache is used anymore:
- removed
redis
and the other adapters - marked
session
as deprecated: It simply checks whether the entry in_users
exists. You should handle this by checking the connection to CouchDB instead.
Cloudant legacy auth via API-Keys is no longer supported. Use couchAuthOnCloudant
instead.
Adjustments to config options, see src/config/default.config.ts
for the new defaults and src/types/config.d.ts
for all available options.
- made the defaults more secure
- more than 10 hashing iterations (
security.iterations
) - disabling of routes (
security.disabledRoutes
) - prevent name guessing via
forgot-password
,register
,change-email
andlogin
- only fully available if
requireEmailConfirm
andemailUsername
aretrue
- only fully available if
And fixed a lot of bugs...
Also lowercasing mails on change-email
Use Cloudant Library for compatibility with IAM auth instead of user:password
(downgraded nano)
- Added 2x retry when working with cloudant
- Using CookieAuth if
cloudant
is true and not IAM
Reject early if no valid email was provided with the request
Only send errors as response that are meant to be user-facing
- Otherwise, just send a generic error
- Adjusted the logging accordingly (warn/error level)
Breaking Compile target is now ES2019, requiring NodeJS 12 or above.
Breaking Replaced PouchDB with Nano. A PouchDB can no longer be passed to SuperLogin. a Nano-DB can be used instead.
- Made deauthorization behaviour more robust against network failures.
logout
now also resolves if access token has only been removed from_user
. - Cloudant and Oauth should work as expected now. Let me know if it does.
- More modules refactored to classes, moved refactored
pouchdb-seed-design
inside this project.
- If password is reset, email will be marked as confirmed and
"'verified via password reset'"
will be logged. - new config options:
local.requirePasswordOnEmailChange
: If true, the correctpassword
is needed in the request body in order to change the email.email.confirmEmailChange
: If set, this template is used when requesting an email change andlocal.confirmEmail
is active./change-email
now responds with"email change requested"
if the email needs to be confirmed
- eslint/prettier for code linting/formatting
- refactored Mailer and User into classes
- provider is now also stored in the doc in CouchDB's
_user
- DB - new config options:
local.sendPasswordChangedEmail
: if true, send a notification email when password is changedsession.dbFallback
: if true, CouchDB will be checked as a fallback if the adapter does not have that session stored
- Travis CI to Node 12, Node 10 no longer supported due to private fields
- Removal of Bluebird in favour of native Promises
- Adjustment of Travis CI for NodeJS 10 with ES6
- Updating all packages to more secure versions
- not allowing
_
as prefix for userDBs - Updated E-Mail Regex
- Added two custom options to config (shorter PW-reset token, sending UUID with session info)
- Misc bugfixes
- Documentation improvements
- Now testing against Node 4.x and 5.x
- Updated dependencies
- Improved unit tests (thanks @tohagan and @ybian)
- CouchDB server can now have a separate URL for public access
- Misc bug fixes
Previously a user could only logout if the session token was still valid. API keys would be expired, but database credentials could still be used. Now logout will ensure the user is completely logged out, even if the session is already expired. Also fixed a bug that was causing sessionLife
and tokenLife
settings not to work.
Default per-DB Cloudant permissions no longer save in the user doc. You can set custom permissions in the user doc, otherwise it will use the settings in your config. Misc bug fixes.
Created configuration options to setup _security roles when user databases are created. Improved tests and updated PouchDB.
Added client access_token
strategies to support OAuth2 flows from Cordova, PhoneGap, and native apps.
The intense power of SuperLogin is unleashed on a world that may not be ready! Tested with Node.js 0.12.7 and 4.0.0.