aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/sqlite/sql/find_session.sql
blob: 31640dd658418a97b1fabc86d79d110b9b3d60a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
select distinct
       i.identity_public_id
       , s.created_at
       , s.expired_at
       , s.revoked_at
from session  s
join identity i using (identity_id)
where (($1 is null) or (s.token_hash = $1))
and (($2 is null) or (i.identity_public_id = $2))
and (($3 is null) or (s.expired_at > $3))
and ((revoked_at is null) or ($4 is null) or (s.revoked_at > $4));