Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bdach
Copy link
Collaborator

@bdach bdach commented Nov 6, 2025

Reported in https://discord.com/channels/188630481301012481/1097318920991559880/1435953371247939594.

VerificationFailureResponse.RequiredSessionVerificationMethod not being nullable means that if it was missing in the verification response, it would not be null but default to TimedOneTimePassword instead, therefore showing TOTP-related error messages to users that never enabled it rather than the user-facing message they were supposed to via the

else
{
LastLoginError = ex;
}
fallback path.

Most easily tested on a local full-stack environment with

diff --git a/app/Libraries/SessionVerification/MailState.php b/app/Libraries/SessionVerification/MailState.php
index 305a2794ec0..3c2d15f335b 100644
--- a/app/Libraries/SessionVerification/MailState.php
+++ b/app/Libraries/SessionVerification/MailState.php
@@ -14,7 +14,7 @@ use Carbon\CarbonImmutable;

 class MailState
 {
-    private const KEY_VALID_DURATION = 600;
+    private const KEY_VALID_DURATION = 10;

     public readonly CarbonImmutable $expiresAt;
     public readonly string $key;

applied so that you don't have to wait 10 minutes to trigger the failure.

`VerificationFailureResponse.RequiredSessionVerificationMethod` not
being nullable means that if it was missing in the verification
response, it would not be `null` but default to `TimedOneTimePassword`
instead, therefore showing TOTP-related error messages to users that
never enabled it rather than the user-facing message they were supposed
to.

Most easily tested on a local full-stack environment with

```diff
diff --git a/app/Libraries/SessionVerification/MailState.php b/app/Libraries/SessionVerification/MailState.php
index 305a2794ec0..3c2d15f335b 100644
--- a/app/Libraries/SessionVerification/MailState.php
+++ b/app/Libraries/SessionVerification/MailState.php
@@ -14,7 +14,7 @@ use Carbon\CarbonImmutable;

 class MailState
 {
-    private const KEY_VALID_DURATION = 600;
+    private const KEY_VALID_DURATION = 10;

     public readonly CarbonImmutable $expiresAt;
     public readonly string $key;
```

applied so that you don't have to wait 10 minutes to trigger the
failure.
@bdach bdach requested a review from a team November 6, 2025 12:46
@bdach bdach self-assigned this Nov 6, 2025
@bdach bdach added area:online functionality Deals with online fetching / sending but don't change much on a surface UI level. quick fix Tasks which were taken on because they take no time to fix labels Nov 6, 2025
@bdach bdach moved this from Next up to Pending Review in osu! untitled project Nov 6, 2025
@smoogipoo smoogipoo merged commit 933fbd2 into ppy:master Nov 6, 2025
7 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Pending Review to Done in osu! untitled project Nov 6, 2025
@bdach bdach deleted the incorrect-verification-handling branch November 6, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:online functionality Deals with online fetching / sending but don't change much on a surface UI level. quick fix Tasks which were taken on because they take no time to fix size/XS

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants