Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consecutive logins fail if done within the same MFA code window, even if a logout is performed in between (tested with MEGAcmd) #2686

Open
FranciscoPombal opened this issue Sep 17, 2024 · 0 comments

Comments

@FranciscoPombal
Copy link

NOTE: Even though I used MEGAcmd to demonstrate this issue, I believe this is an issue in the SDK, or maybe even server-side.

To reproduce

Execute a login, followed by a (full) logout, followed by another login within the validity window of one MFA code (012345 in this example).

$ mega-login --auth-code="012345" [email protected] "${THE_PASSWORD}"
$ mega-logout
Logging out...
$ mega-login --auth-code="012345" [email protected] "${THE_PASSWORD}"
[err: 15:18:13] Failed to Login: Expired

What I expected to happen

The 2nd login should succeed.
More than one login should be possible within the validity window of a single MFA code (possibly even without the need of logging out sessions created within that validity window in between).

What happens instead

The 2nd login fails with a Failed to Login: Expired error.

Rationale

The inability to perform logins within the validity window of a single MFA code hurts the programmability of the MEGA API.
This came up when working on a Go client, t3rm1n4l/go-mega#51, where integration tests perform several sessions logins and logouts in quick succession.
Right now I'm leaning towards saving the secret session token to a file and reusing that - but it seems like a hack, so I'd like to avoid that.
But perhaps I'm looking at it the wrong way? I would appreciate some guidance from the SDK authors about the "intended" way of interacting with the API for use cases like this one.

Version info

$ mega-version
MEGAcmd version: 1.7.0.10: code 1070010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant