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

[5.x]: 'Unable to load the data' error when creating a passkey #14745

Closed
tommysvr opened this issue Apr 3, 2024 · 3 comments
Closed

[5.x]: 'Unable to load the data' error when creating a passkey #14745

tommysvr opened this issue Apr 3, 2024 · 3 comments
Assignees
Labels

Comments

@tommysvr
Copy link

tommysvr commented Apr 3, 2024

What happened?

Description

Unable to create a passkey due to an 'Unable to load the data' error. Underlying error seems to be 'Request must accept JSON in response'.

Steps to reproduce

  1. Your user account > Passkeys > Add a passkey
  2. Follow the steps to save, choosing any method (I got the same error with iCloud Keychain, Chrome and 1Password)

Expected behavior

Passkey is created successfully.

Actual behavior

Receive a generic 'Unable to load the data' with nothing in the logs. Looking at the error in the browser console, I see a 400 error:

yii\web\BadRequestHttpException: Request must accept JSON in response in /var/www/html/vendor/craftcms/cms/src/web/Controller.php:554
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/controllers/AuthController.php(214): craft\web\Controller->requireAcceptsJson()
#1 [internal function]: craft\controllers\AuthController->actionVerifyPasskeyCreation()
#2 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('verify-passkey-...', Array)
#5 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('auth/verify-pas...', Array)
#6 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('auth/verify-pas...', Array)
#7 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /var/www/html/web/index.php(12): yii\base\Application->run()
#10 {main}

Craft CMS version

5.0.0

PHP version

8.2

Operating system and version

No response

Database type and version

MySQL 8.0

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

brandonkelly commented Apr 3, 2024

What browser/OS are you using? And are you expecting to use the browser’s native passkey support, or an extension’s (like 1Password)?

@i-just
Copy link
Contributor

i-just commented Apr 3, 2024

I can replicate. Looking into it!

@brandonkelly
Copy link
Member

Fixed in 5.0.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants