You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-11-20 12:02:22 +03:00
Convert many match/if expressions to let-else
This commit is contained in:
@@ -107,9 +107,7 @@ pub(crate) async fn get(
|
||||
let callback_destination = CallbackDestination::try_from(&grant)?;
|
||||
let continue_grant = PostAuthAction::continue_grant(grant.id);
|
||||
|
||||
let session = if let Some(session) = maybe_session {
|
||||
session
|
||||
} else {
|
||||
let Some(session) = maybe_session else {
|
||||
// If there is no session, redirect to the login screen, redirecting here after
|
||||
// logout
|
||||
return Ok((cookie_jar, mas_router::Login::and_then(continue_grant).go()).into_response());
|
||||
|
||||
@@ -166,9 +166,7 @@ pub(crate) async fn post(
|
||||
.ok_or(RouteError::GrantNotFound)?;
|
||||
let next = PostAuthAction::continue_grant(grant_id);
|
||||
|
||||
let session = if let Some(session) = maybe_session {
|
||||
session
|
||||
} else {
|
||||
let Some(session) = maybe_session else {
|
||||
let login = mas_router::Login::and_then(next);
|
||||
return Ok((cookie_jar, login.go()).into_response());
|
||||
};
|
||||
|
||||
@@ -154,9 +154,7 @@ pub(crate) async fn post(
|
||||
.verify(&http_client_factory, &encrypter, method, &client)
|
||||
.await?;
|
||||
|
||||
let form = if let Some(form) = client_authorization.form {
|
||||
form
|
||||
} else {
|
||||
let Some(form) = client_authorization.form else {
|
||||
return Err(RouteError::BadRequest);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user