* api: pass user object to auth hooks
The motivation for this is the ability to migrate from
bcrypt passwords to argon2 seamlessly.
Fixes#4718Fixes#4335
* receive user from `auth.login.before` hook
* pass `otp` as well on `auth.login` hooks
* api: last registered hook should have priority
When registering multiple hooks for a single event,
the last hook should have priority on return value.
* Fix linter warning
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
* Disabled string to text migrations for Oracle
* Added oracle specific alter table migrations
* Added notNull parameter to Oracle alter function
* Wrapped notNull in if
* Removed public oracle column alter function
* Fixed issues with template overriding
* Remove `system` flag from email templates
* Remove usage of system in user services
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
* Allow nodemailer SMTP configuration with no authentication
* Fix typing + use or instead of and for user/pass combo
Co-authored-by: Fady Khalife <fady.khalife@yakkazoo.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
* Make email template overrides work
The ternary needs to be this way for custom email templates to be picked up.
* Allow custom subject lines for emails
Allow subject line to be passed into `inviteUser()` and `requestPasswordReset()`
* Fix typo
* Revert so only one change for PR
* fix typo
* Fix ts tests
* Make email template overrides work
The ternary needs to be this way for custom email templates to be picked up.
* Allow custom subject lines for emails
Allow subject line to be passed into `inviteUser()` and `requestPasswordReset()`
* Fix typo
* Fix typo
* eslint stuff
* Update users.ts
* Rotate JPG image on upload #4206
* fixes#3949 width/height generated for gif and tif
* API hooks for event added for auth.login #4079
* updated doc for api hooks for new auth.login event
* Style tweaks
* Update docs
* Tweak docs some more
* Spelling error
* Allow non-required flags and pass to hook
* SDK - Persistent login refresh fixes#4113
* Fixed#4145 SDK, Token Expired error
* Spell check
* Docs Spell check
* Docs Spell check
* Docs Spell check
* update docs for sdk-js
* To delete all expired session from db on login
* corrected the condition for the delete
* changed the from Date.now to new date .
* Move it inline
* Added Knex option for Session store
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
* Declare return types on functions
And a very few other type related minor fixes
* Minor syntax fixes
* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)