1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Refactor the upstream link provider template logic

Also adds tests for new account registration through an upstream oauth2
provider
This commit is contained in:
Quentin Gliech
2023-11-13 12:29:01 +01:00
parent 9c94e11e68
commit 89420a2cfc
9 changed files with 560 additions and 153 deletions

View File

@@ -130,4 +130,13 @@ impl ImportAction {
pub fn is_required(&self) -> bool {
matches!(self, Self::Require)
}
#[must_use]
pub fn should_import(&self, user_preference: bool) -> bool {
match self {
Self::Ignore => false,
Self::Suggest => user_preference,
Self::Force | Self::Require => true,
}
}
}