In AuthomaticView.__call__ (browser/view.py), an authenticated user visiting a configured provider always hits:
if not self.is_anon:
if provider in self._provider_names:
return self._redirect()
_provider_names returns the configured providers (self.config.keys()), and provider has already been validated against cfg earlier in __call__, so provider in self._provider_names is always true here. As a result the code never reaches the _add_identity branch further down — the "add a provider identity to an existing, logged-in account" feature is effectively dead via this view, and view.py lines ~135/151 are unreachable (surfaced while raising coverage to 97% in #112).
The check most likely intended to compare against the current user's already-connected identities, not the configured providers.
Suggested fix
- Add a method returning the logged-in user's connected provider names (from the plugin's
UserIdentities), and gate the early redirect on that instead of _provider_names.
- Add a test covering the authenticated "add identity" flow once reachable.
Found during PR #115.
In
AuthomaticView.__call__(browser/view.py), an authenticated user visiting a configured provider always hits:_provider_namesreturns the configured providers (self.config.keys()), andproviderhas already been validated againstcfgearlier in__call__, soprovider in self._provider_namesis always true here. As a result the code never reaches the_add_identitybranch further down — the "add a provider identity to an existing, logged-in account" feature is effectively dead via this view, andview.pylines ~135/151 are unreachable (surfaced while raising coverage to 97% in #112).The check most likely intended to compare against the current user's already-connected identities, not the configured providers.
Suggested fix
UserIdentities), and gate the early redirect on that instead of_provider_names.Found during PR #115.