mohe2015 / AuthManagerOAuth

Create accounts or login using OAuth
GNU General Public License v2.0
0 stars 1 forks source link

Users cannot change from github login to email authentication #40

Open Mic92 opened 7 months ago

Mic92 commented 7 months ago

Steps to reproduce

  1. Login with GitHub
  2. Add an email address i.e. via website or from command line:
sudo -u mediawiki mediawiki-maintenance resetUserEmail.php someuser someemail@example.com
LogicException from line 112 of /nix/store/1j63yq10zrmclcsbdp8vhwj722nk4vqr-source/src/AuthManagerOAuthPrimaryAuthenticationProvider.php: Unexpected unhandled request
#0 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/includes/auth/AuthManager.php(2629): MediaWiki\Extension\AuthManagerOAuth\AuthManagerOAuthPrimaryAuthenticationProvider->providerChangeAuthenticationData(Object(MediaWiki\Auth\PasswordAuthenticationRequest))
#1 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/includes/auth/AuthManager.php(1031): MediaWiki\Auth\AuthManager->callMethodOnProviders(6, 'providerChangeA...', Array)
#2 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/includes/user/User.php(1902): MediaWiki\Auth\AuthManager->changeAuthenticationData(Object(MediaWiki\Auth\PasswordAuthenticationRequest))
#3 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/maintenance/resetUserEmail.php(77): MediaWiki\User\User->changeAuthenticationData(Array)
#4 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/maintenance/includes/MaintenanceRunner.php(703): ResetUserEmail->execute()
#5 /nix/store/3f2vbfgs36s95x3g9y4j7zfy9g62hrjp-mediawiki-full-1.41.0/share/mediawiki/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#6 {main}

This happens in wiki.nixos.org

Mic92 commented 7 months ago

Affected code line: https://github.com/mohe2015/AuthManagerOAuth/blob/07003f4f23b7e15d708f918895d4c0027cb4a9ce/src/AuthManagerOAuthPrimaryAuthenticationProvider.php#L112

mohe2015 commented 7 months ago

Potentially we should not throw but instead just do nothing in that case. I currently don't have the capacity to look into this deeper but would be open to a pull request.

Also I would be open to move this repo to some org of your choice.

nyabinary commented 7 months ago

Potentially we should not throw but instead just do nothing in that case. I currently don't have the capacity to look into this deeper but would be open to a pull request.

Also I would be open to move this repo to some org of your choice.

NixOS Org? As the wiki-infra is also hosted there: https://github.com/NixOS/nixos-wiki-infra

Mic92 commented 7 months ago

https://github.com/nix-community would be also fine, or even just have allow multiple maintainers on the project. But as long as pull requests are still accepted, I don't need any of that.

nyabinary commented 7 months ago

https://github.com/nix-community would be also fine, or even just have allow multiple maintainers on the project. But as long as pull requests are still accepted, I don't need any of that.

Could make the nixos-wiki-infra a monorepo too for projects that are used in the wiki.

mohe2015 commented 7 months ago

https://github.com/nix-community would be also fine, or even just have allow multiple maintainers on the project. But as long as pull requests are still accepted, I don't need any of that.

Could make the nixos-wiki-infra a monorepo too for projects that are used in the wiki.

I think I would prefer this to stay a separate repository as this project is mostly independent from NixOS even though it got specifically developed for it.

Also as long as Mic92 is fine with the current state we can simply keep it as is I think.