From f0ea9ecd17b03605d747044874a26e1bd52c0ee1 Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Thu, 29 Dec 2022 00:09:27 -0800
Subject: revoke session (+ some cleanup)

---
 crates/secd/store/pg/sql/write_session.sql | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'crates/secd/store/pg/sql/write_session.sql')

diff --git a/crates/secd/store/pg/sql/write_session.sql b/crates/secd/store/pg/sql/write_session.sql
index 18dc1f1..aa9c0a1 100644
--- a/crates/secd/store/pg/sql/write_session.sql
+++ b/crates/secd/store/pg/sql/write_session.sql
@@ -7,4 +7,5 @@ insert into secd.session (
 ) values (
   (select identity_id from secd.identity where identity_public_id = $1)
   , $2, $3, $4, $5
-);
+) on conflict (token_hash) do update
+  set revoked_at = excluded.revoked_at;
-- 
cgit v1.2.3

