mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: lock auth session (#18322)
This commit is contained in:
parent
ecb66fdb2c
commit
c1150fe7e3
37 changed files with 765 additions and 123 deletions
|
|
@ -199,6 +199,15 @@ where
|
|||
"partners"."sharedById" in ($1)
|
||||
and "partners"."sharedWithId" = $2
|
||||
|
||||
-- AccessRepository.session.checkOwnerAccess
|
||||
select
|
||||
"sessions"."id"
|
||||
from
|
||||
"sessions"
|
||||
where
|
||||
"sessions"."id" in ($1)
|
||||
and "sessions"."userId" = $2
|
||||
|
||||
-- AccessRepository.stack.checkOwnerAccess
|
||||
select
|
||||
"stacks"."id"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- SessionRepository.search
|
||||
-- SessionRepository.get
|
||||
select
|
||||
*
|
||||
"id",
|
||||
"expiresAt",
|
||||
"pinExpiresAt"
|
||||
from
|
||||
"sessions"
|
||||
where
|
||||
"sessions"."updatedAt" <= $1
|
||||
"id" = $1
|
||||
|
||||
-- SessionRepository.getByToken
|
||||
select
|
||||
|
|
@ -37,8 +39,8 @@ from
|
|||
where
|
||||
"sessions"."token" = $1
|
||||
and (
|
||||
"sessions"."expiredAt" is null
|
||||
or "sessions"."expiredAt" > $2
|
||||
"sessions"."expiresAt" is null
|
||||
or "sessions"."expiresAt" > $2
|
||||
)
|
||||
|
||||
-- SessionRepository.getByUserId
|
||||
|
|
@ -50,6 +52,10 @@ from
|
|||
and "users"."deletedAt" is null
|
||||
where
|
||||
"sessions"."userId" = $1
|
||||
and (
|
||||
"sessions"."expiresAt" is null
|
||||
or "sessions"."expiresAt" > $2
|
||||
)
|
||||
order by
|
||||
"sessions"."updatedAt" desc,
|
||||
"sessions"."createdAt" desc
|
||||
|
|
@ -58,3 +64,10 @@ order by
|
|||
delete from "sessions"
|
||||
where
|
||||
"id" = $1::uuid
|
||||
|
||||
-- SessionRepository.lockAll
|
||||
update "sessions"
|
||||
set
|
||||
"pinExpiresAt" = $1
|
||||
where
|
||||
"userId" = $2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue