Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Commit

Permalink
fix/Sanitise the auth URI to remove invalid / characters before usi…
Browse files Browse the repository at this point in the history
…ng it to log in (#95)
  • Loading branch information
bochaco authored and hitman401 committed Jul 3, 2017
1 parent a6f9891 commit eea78bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ class AuthInterface {
* authenticated session.
*/
loginFromURI(responseUri) {
return lib.decode_ipc_msg(responseUri).then((resp) => {
// FIXME: this is a temporary patch to overcome an issue with some OS,
// like Fedora, where the URI returned has '/' characters after the ':'
// making the URI invalid for decoding.
const sanitisedUri = responseUri.replace(/:\/+/g, ':'); // Convert a substring with ':' followed by any number of '/' to ':'
return lib.decode_ipc_msg(sanitisedUri).then((resp) => {
// we can only handle 'granted' and 'unregistered' request
if (resp[0] === 'unregistered') {
this._registered = false;
Expand Down

0 comments on commit eea78bf

Please sign in to comment.