Prefer deleting sessions by their UUID
Instead of deleting them by usernames.
This commit is contained in:
parent
c4a090e558
commit
16f50e33bc
1 changed files with 3 additions and 3 deletions
|
@ -43,9 +43,9 @@ refresh dbFile uuid = withConnection dbFile $ \conn -> do
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
-- | Delete the session under `username` from `dbFile`.
|
-- | Delete the session under `username` from `dbFile`.
|
||||||
delete :: FilePath -> T.Username -> IO ()
|
delete :: FilePath -> T.SessionUUID -> IO ()
|
||||||
delete dbFile username = withConnection dbFile $ \conn ->
|
delete dbFile uuid = withConnection dbFile $ \conn ->
|
||||||
execute conn "DELETE FROM Sessions WHERE username = ?" (Only username)
|
execute conn "DELETE FROM Sessions WHERE uuid = ?" (Only uuid)
|
||||||
|
|
||||||
-- | Find or create a session in the Sessions table. If a session exists,
|
-- | Find or create a session in the Sessions table. If a session exists,
|
||||||
-- refresh the token's validity.
|
-- refresh the token's validity.
|
||||||
|
|
Loading…
Reference in a new issue