You've already forked authentication-service
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:
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user