Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Oct 2, 2018

Now that we can enforce 2FA we also should notify users that have
enabled 2FA but do not yet have backup codes generated.

This adds a repair step that inserts a background job to do this.

Signed-off-by: Roeland Jago Douma roeland@famdouma.nl

@rullzer rullzer added enhancement 3. to review Waiting for reviews labels Oct 2, 2018
@rullzer rullzer added this to the Nextcloud 15 milestone Oct 2, 2018
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

protected function run($argument) {
$this->userManager->callForSeenUsers(function(IUser $user) {
$providers = $this->registry->getProviderStates($user);
$enabledProviders = $this->twofactorManager->isTwoFactorAuthenticated($user);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$isTwoFactorAuthenticated?

$providers = $this->registry->getProviderStates($user);
$enabledProviders = $this->twofactorManager->isTwoFactorAuthenticated($user);

if ($enabledProviders && $providers['backup_codes'] === false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be set, but maybe add a isset check for the backup_codes key for the case that the registry state is not yet populated

Now that we can enforce 2FA we also should notify users that have
enabled 2FA but do not yet have backup codes generated.

This adds a repair step that inserts a background job to do this.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer force-pushed the feature/background_job_to_check branch from f043e97 to 36bf522 Compare October 2, 2018 18:42
@MorrisJobke MorrisJobke merged commit c70e3c5 into master Oct 2, 2018
@MorrisJobke MorrisJobke deleted the feature/background_job_to_check branch October 2, 2018 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants