mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-10-12 09:19:04 +00:00
Update crates/handlers/src/upstream_oauth2/link.rs
Co-authored-by: Quentin Gliech <quenting@element.io>
This commit is contained in:
co-authored by
Quentin Gliech
parent
2866f7994d
commit
3e9d572e2f
@@ -694,9 +694,12 @@ pub(crate) async fn post(
|
||||
.as_deref()
|
||||
.unwrap_or(DEFAULT_LOCALPART_TEMPLATE);
|
||||
|
||||
let localpart = render_attribute_template(&env, template, &context, true)?;
|
||||
let Some(localpart) = render_attribute_template(&env, template, &context, true)? else {
|
||||
// This should never be the case at this point
|
||||
return Err(RouteError::InvalidFormAction);
|
||||
};
|
||||
|
||||
let maybe_user = repo.user().find_by_username(&localpart.unwrap()).await?;
|
||||
let maybe_user = repo.user().find_by_username(&localpart).await?;
|
||||
|
||||
let Some(user) = maybe_user else {
|
||||
// user cannot be None at this stage
|
||||
|
||||
Reference in New Issue
Block a user