mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Account for share when updating stateful sessions (#22867)
* Account for share when updating stateful sessions * Add changeset
This commit is contained in:
5
.changeset/shaggy-bees-search.md
Normal file
5
.changeset/shaggy-bees-search.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/api': patch
|
||||
---
|
||||
|
||||
Added missing share ID when refreshing/updating share sessions
|
||||
@@ -417,7 +417,10 @@ export class AuthenticationService {
|
||||
// Clear expired sessions for the current user
|
||||
await this.knex('directus_sessions')
|
||||
.delete()
|
||||
.where('user', '=', record.user_id)
|
||||
.where({
|
||||
user: record.user_id,
|
||||
share: record.share_id,
|
||||
})
|
||||
.andWhere('expires', '<', new Date());
|
||||
|
||||
return {
|
||||
@@ -476,6 +479,7 @@ export class AuthenticationService {
|
||||
await this.knex('directus_sessions').insert({
|
||||
token: newSessionToken,
|
||||
user: sessionRecord['user_id'],
|
||||
share: sessionRecord['share_id'],
|
||||
expires: sessionExpiration,
|
||||
ip: this.accountability?.ip,
|
||||
user_agent: this.accountability?.userAgent,
|
||||
|
||||
Reference in New Issue
Block a user