Skip to content

Commit ae1a2e7

Browse files
committed
throw error when configuration is wrong
1 parent 5a2428a commit ae1a2e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/config/src/sections/upstream_oauth2.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ impl ConfigurationSection for UpstreamOAuth2Config {
110110
}
111111
}
112112
}
113+
114+
if provider.allow_existing_users
115+
&& !matches!(
116+
provider.claims_imports.localpart.action,
117+
ImportAction::Force | ImportAction::Require
118+
)
119+
{
120+
return annotate(figment::Error::custom(
121+
"When `allow_existing_users` is true, localpart claim import must be either `force` or `require`",
122+
));
123+
}
113124
}
114125

115126
Ok(())

0 commit comments

Comments
 (0)