Skip to content

Settings.config callback crashes when passed option containing encoded percent sign #171

@compelling

Description

@compelling

Hi, I have have several users of Grosh for Pebble reporting they can login to the app in the settings web page running inside Pebble Time app, but the watch fails to connect using the credentials transferred back to the watch app from the web page.

Did some tests, and it turns out you cannot transfer password containing % sign.
The web page encodes the options
var location = "pebblejs://close#" + encodeURIComponent(JSON.stringify(options)); console.log("Warping to: " + location);

When entering [email protected] - G1234% and looking at the console, this looks fine:
Warping to: pebblejs://close#%7B%22email%22%3A%22g%40gmail.com%22%2C%22password%22%3A%22G1234%25%22%7D

So the % is nicely escaped. But the watch app dies:
URIError: URI error decodeURIComponent@[native code] at onCloseConfig (settings/settings.js:186:43)

Any ideas how to get around this, except telling users to stop using % in their password?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions