You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Login always fails for members with two-factor authentication enabled (Galette 1.3.0) #90
Since Galette 1.3.0 introduced two-factor authentication, members who have a second factor enabled can no longer log in through the OAuth2 plugin.
The OAuth2 login form always shows "Check your login / email or password.", even though the credentials are correct.
Steps to reproduce
On Galette 1.3.0, enable 2FA (optional mode is enough) and enrol a member account.
From a client application (WordPress in our case), start the OAuth2 authorization flow.
On the plugin login screen, enter the valid credentials of that member.
Expected: the member is asked for their second factor, then the authorization flow continues. Actual: "Check your login / email or password." is shown, and the flow cannot go further.
Members without 2FA can still log in normally.
Logs
INFO - User `xxxxx` logged in.
DEBUG - UserHelper::login(xxxxx) return ''
DEBUG - login() - URI: /plugins/oauth2/login
Galette accepts the password, but UserHelper::login() still returns false.
Analysis
UserHelper::login() calls Login::logIn() and then checks Login::isLogged().
Since Galette 1.3.0, Login::logIn() calls requireTwoFactor() when the member owes a second factor. isLogged() then stays false and isTwoFactorPending() becomes true until the code has been verified. As the comment in Login::needsTwoFactor() says, this fails closed on purpose for any caller outside the core that calls logIn() and then isLogged().
The plugin has no handling for the pending second factor (no TwoFactor reference anywhere), so it treats this state as a wrong password.
Possible fix
When logIn() succeeds and isTwoFactorPending() is true:
either redirect to Galette's core 2FA challenge, then come back to the OAuth2 authorization flow;
or show a second-factor step in the plugin login page.
As a minimum, showing a specific message such as "Two-factor authentication is not supported yet" would avoid sending users looking for a password error.
I’ll test tonight. But I’ll have to bypass my upgrade pipeline as this isn’t a tagged release (that cannot be found by the script). I’ll provide my test and logs.
Activity
trasher commentedon Oct 13, 2026
May be fixed with #95, please test.
Redirecting to core cannot work because plugin owes its own session- so it's been done on plugin side.
Linedwell commentedon Oct 13, 2026
Will be tested when a tag will be published (my deployement script downloads a zip, it doesn't git clone the repository).
trasher commentedon Oct 13, 2026
I'd need confirmation before merge; I do not want ot have to make another release to fix somehting that could have been found now.
Linedwell commentedon Oct 15, 2026
I’ll test tonight. But I’ll have to bypass my upgrade pipeline as this isn’t a tagged release (that cannot be found by the script). I’ll provide my test and logs.
Linedwell commentedon Oct 15, 2026
I can confirm that the fix works as intended:
Here are the galette logs for my connection attempt.
trasher commentedon Oct 15, 2026
Great, thanks for testing! I'll make a new release soon with that fix.