1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-05 10:42:14 +03:00

Pass the rng and clock around

This commit is contained in:
Quentin Gliech
2022-10-21 18:50:06 +02:00
parent 5c7e66a9b2
commit 559181c2c3
40 changed files with 504 additions and 218 deletions

View File

@@ -12,12 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use chrono::Utc;
use mas_data_model::Session;
use sqlx::PgExecutor;
use uuid::Uuid;
use crate::PostgresqlBackend;
use crate::{Clock, PostgresqlBackend};
pub mod access_token;
pub mod authorization_grant;
@@ -37,9 +36,10 @@ pub mod refresh_token;
)]
pub async fn end_oauth_session(
executor: impl PgExecutor<'_>,
clock: &Clock,
session: Session<PostgresqlBackend>,
) -> Result<(), anyhow::Error> {
let finished_at = Utc::now();
let finished_at = clock.now();
let res = sqlx::query!(
r#"
UPDATE oauth2_sessions