Skip to content

[5.x]: Adding Two-Step Verification with a Permissions-Policy that does not allow synchronous requests #15348

@jamesmacwhite

Description

@jamesmacwhite

What happened?

Description

When attempting to enable two-step verification on a production environment, when verifying a one-time code from the generated seed, the verify action did not provide any success or fail message and returned back to the user screen with the two-step verification option showing as "set-up".

Looking in the console, there were two errors raised, one around synchronous requests being blocked by the Permissions-Policy set and another related to Uncaught Type error.

jquery.js?v=1720878074:2 [Violation] Permissions policy violation: Synchronous requests are disabled by permissions policy.
send @ jquery.js?v=1720878074:2
ajax @ jquery.js?v=1720878074:2
T._evalUrl @ jquery.js?v=1720878074:2
_e @ jquery.js?v=1720878074:2
append @ jquery.js?v=1720878074:2
(anonymous) @ Craft.js:1973
u @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:2
as @ Craft.js:2
s @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:1974
(anonymous) @ Craft.js:1993
u @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:2
as @ Craft.js:2
s @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:2
(anonymous) @ Craft.js:1994
(anonymous) @ AuthMethodSetup.js:51
h @ AuthMethodSetup.js:2
(anonymous) @ AuthMethodSetup.js:2
(anonymous) @ AuthMethodSetup.js:2
n @ AuthMethodSetup.js:2
s @ AuthMethodSetup.js:2
Promise.then (async)
n @ AuthMethodSetup.js:2
s @ AuthMethodSetup.js:2
(anonymous) @ AuthMethodSetup.js:2
(anonymous) @ AuthMethodSetup.js:2
(anonymous) @ AuthMethodSetup.js:68
Promise.then (async)
(anonymous) @ AuthMethodSetup.js:48
onHide @ ElevatedSessionManager.js:117
onHide @ Modal.js:219
hide @ Modal.js:214
onLogin @ ElevatedSessionManager.js:104
(anonymous) @ LoginForm.js:167
Promise.then (async)
onSubmit @ LoginForm.js:162
(anonymous) @ Base.js:162
o @ jquery.js?v=1720878074:2
dispatch @ jquery.js?v=1720878074:2
v.handle @ jquery.js?v=1720878074:2

VM2264:8 Uncaught TypeError: Cannot read properties of undefined (reading 'METHOD')
at :8:44
at m (jquery.js?v=1720878074:2:867)
at _e (jquery.js?v=1720878074:2:46232)
at T.fn.init.append (jquery.js?v=1720878074:2:47441)
at Craft.js:1973:13
at u (Craft.js:2:1)
at Generator. (Craft.js:2:1)
at Generator.next (Craft.js:2:1)
at as (Craft.js:2:1)
at s (Craft.js:2:1)

I don't know if there's a more friendly way to identify this, given I had to go into Developer Tools to get an idea to know something was wrong.

Expected behavior

Some form of error to indicate an issue.

Actual behavior

Fails silently.

Craft CMS version

5.2.6 Solo

PHP version

8.3

Operating system and version

No response

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions