nextcloud / nextcloud/twofactor_webauthn

Only display « Migrating devices of user » for users who actually have u2f keys in migration

Open Beginner friendly
#147 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
59
Forks
11
Avg merge
1d 10h
Merged PRs (30d)
16

Description

Steps to reproduce
  1. Have a lot of users
  2. Execute php occ twofactor_webauthn:migrate-u2f --all
Expected behaviour

The message Migrating devices of user X should only be displayed for users with actual u2f keys registered.

Actual behaviour

The message is displayed for all users, even if they don't have any registered u2f keys to migrate

Fix

An easy fix is to make sure the following line only executes if count($registrations) > 0.

https://github.com/nextcloud/twofactor_webauthn/blob/419dc0999f48dcbe02083604d0a7c3912fdf94ea/lib/Command/MigrateU2F.php#L123

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open lib/Command/MigrateU2F.php at the referenced line and inspect how registrations are collected in the twofactor_webauthn:migrate-u2f command. Ensure the migration message is only shown when registrations contain at least one key, then verify that users without registered U2F keys produce no message.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.