mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
refactor(threepid): Use SyncMutex and decouple guard from ValidSession
Change threepid sessions and send_attempts to SyncMutex and avoid holding the sessions mutex across callers of get_valid_session.
This commit is contained in:
7 files changed
+90
-98
No files matched your search
@@ -167,7 +167,6 @@ async fn get_change_email_validate(
|
||||
let Ok(session) = services
|
||||
.threepid
|
||||
.get_valid_session(&session_id, &client_secret)
|
||||
.await
|
||||
else {
|
||||
return response!(ChangeEmailValidate::new(
|
||||
context,
|
||||
|
||||
@@ -189,7 +189,6 @@ async fn route_reset_password_validate(
|
||||
let body = match services
|
||||
.threepid
|
||||
.get_valid_session(&query.threepid.session_id, &query.threepid.client_secret)
|
||||
.await
|
||||
{
|
||||
| Ok(session) => {
|
||||
let Some(localpart) = services
|
||||
|
||||
@@ -289,7 +289,6 @@ async fn get_register_email_validate(
|
||||
let Ok(session) = services
|
||||
.threepid
|
||||
.get_valid_session(&session_id, &client_secret)
|
||||
.await
|
||||
else {
|
||||
return response!(RegisterEmailValidate::new(context, session_id, client_secret, true));
|
||||
};
|
||||
|
||||
@@ -33,7 +33,6 @@ async fn threepid_validation(
|
||||
services
|
||||
.threepid
|
||||
.try_validate_session(&query.session, &query.token)
|
||||
.await
|
||||
.map_err(|message| WebError::BadRequest(message.into_owned()))?;
|
||||
|
||||
Ok(ThreepidValidation::new(context))
|
||||
|
||||
Reference in new issue
Block a user