about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-07-29T19·21+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-07-29T19·21+0100
commit16f50e33bc20cfd1010d22c8533c0e6666a41f4c (patch)
tree98893255908be320a16f815e50ed9524620bfd42
parentc4a090e55803864c21e8c40432ca17772247ca8e (diff)
Prefer deleting sessions by their UUID
Instead of deleting them by usernames.
-rw-r--r--src/Sessions.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sessions.hs b/src/Sessions.hs
index 1d3f0d6e88fa..12b641b92ff6 100644
--- a/src/Sessions.hs
+++ b/src/Sessions.hs
@@ -43,9 +43,9 @@ refresh dbFile uuid = withConnection dbFile $ \conn -> do
   pure ()
 
 -- | Delete the session under `username` from `dbFile`.
-delete :: FilePath -> T.Username -> IO ()
-delete dbFile username = withConnection dbFile $ \conn ->
-  execute conn "DELETE FROM Sessions WHERE username = ?" (Only username)
+delete :: FilePath -> T.SessionUUID -> IO ()
+delete dbFile uuid = withConnection dbFile $ \conn ->
+  execute conn "DELETE FROM Sessions WHERE uuid = ?" (Only uuid)
 
 -- | Find or create a session in the Sessions table. If a session exists,
 -- refresh the token's validity.