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

webauthn defineWebAuthnRegisterEventHandler error in dev mode with https #271

Open
germsb opened this issue Nov 7, 2024 · 1 comment
Open

Comments

@germsb
Copy link

germsb commented Nov 7, 2024

Hello,

I get an error in the defineWebAuthnRegisterEventHandler

validateUser
validateUser ok {
  "userName": "[email protected]"
}
excludeCredentials
{ id: '480465be-c7fc-4b15-b277-21e03805bf9a', webauthn: null }
excludeCredentials ok [
  null
]
storeChallenge
storeChallenge ok
validateUser
validateUser ok {
  "userName": "[email protected]"
}
getChallenge
getChallenge ok bC5Poq9lx6gXrOlZXGF-bSbMQSkcziq9-X7w2mVWQsU

ERROR  [nuxt] [request error] [unhandled] [500] Unexpected registration response origin "https://localhost:3000", expected "http://localhost:3000"

//nuxt.config

{
//...
devServer: {
        https: {
            cert: 'cert/mydomain+1.pem',
            key: 'cert/mydomain+1-key.pem'
        }
    },
//...
}

//package.json
"dev": "nuxt dev --host ",

Maybe related with the H3 getRequestProtocol(event) / getRequestProtocol(event, {xForwardedProto: true}) which always returns http !? #nuxt/cli#324 #nuxt/nuxt#25108 #nuxt/cli#487

@germsb
Copy link
Author

germsb commented Nov 22, 2024

Hello
Has anyone else encountered this issue? How do you handle local testing?
At the moment, I have to build and push to the remote server after every change for debugging, which is far from ideal.
Any advice?

Edit:
Provisionally resolved with:

//package.json
...
"dev-https-fix": "nuxi dev --no-fork --host"
...

// .env
NODE_TLS_REJECT_UNAUTHORIZED=0

With the counterpart:
ERROR (node:55979) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. 12:10:37 (Use node --trace-warnings ... to show where the warning was created)

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