Skip to content

Commit ce6f019

Browse files
committed
Don't read refresh tokens that don't have associated access tokens
These appear to be accidental and should not be migrated.
1 parent 38dc8a0 commit ce6f019

File tree

1 file changed

+1
-1
lines changed
  • crates/syn2mas/src/synapse_reader

1 file changed

+1
-1
lines changed

crates/syn2mas/src/synapse_reader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl<'conn> SynapseReader<'conn> {
511511
SELECT
512512
rt0.user_id, rt0.device_id, at0.token AS access_token, rt0.token AS refresh_token, at0.valid_until_ms, at0.last_validated
513513
FROM refresh_tokens rt0
514-
LEFT JOIN access_tokens at0 ON at0.refresh_token_id = rt0.id AND at0.user_id = rt0.user_id AND at0.device_id = rt0.device_id
514+
INNER JOIN access_tokens at0 ON at0.refresh_token_id = rt0.id AND at0.user_id = rt0.user_id AND at0.device_id = rt0.device_id
515515
LEFT JOIN access_tokens at1 ON at1.refresh_token_id = rt0.next_token_id
516516
WHERE NOT at1.used OR at1.used IS NULL
517517
",

0 commit comments

Comments
 (0)