Skip to content

Commit 5dfa9b9

Browse files
committed
Recognise macaroons as access tokens from Synapse
1 parent 2605d3a commit 5dfa9b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/data-model/src/tokens.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ impl TokenType {
294294
pub fn check(token: &str) -> Result<TokenType, TokenFormatError> {
295295
// these are legacy tokens imported from Synapse
296296
// we don't do any validation on them and continue as is
297-
if token.starts_with("syt_") {
297+
// Tokens starting `MDAx` are macaroons from even older versions of Synapse.
298+
if token.starts_with("syt_") || token.starts_with("MDAx") {
298299
return Ok(TokenType::CompatAccessToken);
299300
}
300301
if token.starts_with("syr_") {

0 commit comments

Comments
 (0)