To clear to Expired Sessions#4414 (#4504)

* 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

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Pyll Gomez
2021-03-12 18:11:44 -05:00
committed by GitHub
parent 2cdf18545e
commit 4dd69ee5b1

View File

@@ -128,6 +128,8 @@ export class AuthenticationService {
user_agent: userAgent,
});
await database('directus_sessions').delete().where('expires', '<', new Date());
if (this.accountability) {
await this.activityService.create({
action: Action.AUTHENTICATE,