Giter Club home page Giter Club logo

Comments (2)

davidearl avatar davidearl commented on July 20, 2024

You aren't giving much to go on. The error message is straightforward: a string being passed into json_decode is not valid JSON. What platform are you on (server and client)? What kind of key is it? What is the string that's causing the problem and where in the code? Have you changed the code in any way?

There are two json_decode calls during registration, one near the top of WebAuthn::register where it decodes the information provided by the key, and the other near the end of that function where it decodes the other parameter, the user's existing keys. You should have a line number for which one it was, and I would put some logging just before the relevant call to find out what the string is that is being passed in, the one it is complaining about.

If you haven't changed the code at all, chances are it is the first one, as the second one is only used on registration of additional keys, and the example doesn't allow for adding a key to an existing user. Which rather suggests that what should be passed into the json_decode call is being corrupted somewhere.

Once you've established where the problem is and what the problem string is, if it is indeed the first call, then I'd look at the network request in the browser debugger, to see what is actually being sent. If that's the same as the string that's causing the problem, then the problem is on the client side; and if not it is on the server side, so we'll know where to look next.

from webauthn.

davidearl avatar davidearl commented on July 20, 2024

You might also want to check permission where the code writes the user database. If it can't write to that, it will inevitably fail.

from webauthn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.