We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2866f79 commit 3e9d572Copy full SHA for 3e9d572
crates/handlers/src/upstream_oauth2/link.rs
@@ -694,9 +694,12 @@ pub(crate) async fn post(
694
.as_deref()
695
.unwrap_or(DEFAULT_LOCALPART_TEMPLATE);
696
697
- let localpart = render_attribute_template(&env, template, &context, true)?;
+ let Some(localpart) = render_attribute_template(&env, template, &context, true)? else {
698
+ // This should never be the case at this point
699
+ return Err(RouteError::InvalidFormAction);
700
+ };
701
- let maybe_user = repo.user().find_by_username(&localpart.unwrap()).await?;
702
+ let maybe_user = repo.user().find_by_username(&localpart).await?;
703
704
let Some(user) = maybe_user else {
705
// user cannot be None at this stage
0 commit comments