1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-21 23:00:50 +03:00

Refactor token generation a bit

This commit is contained in:
Quentin Gliech
2021-09-23 14:24:44 +02:00
parent 29126e336e
commit a9f1f8bb71
6 changed files with 61 additions and 59 deletions

View File

@@ -26,7 +26,7 @@ use crate::{
database::connection,
},
storage::oauth2::{access_token::lookup_access_token, refresh_token::lookup_refresh_token},
tokens,
tokens::{self, TokenType},
};
pub fn filter(
@@ -70,7 +70,7 @@ async fn introspect(
}
let token = &params.token;
let token_type = tokens::check(token).wrap_error()?;
let token_type = TokenType::check(token).wrap_error()?;
if let Some(hint) = params.token_type_hint {
if token_type != hint {
info!("Token type hint did not match");