KyrneDev / Shout-public

Public codebase for my Flarum PM extension.
GNU General Public License v3.0
9 stars 2 forks source link

Encryption setup doesn't happen #4

Open TheDcoder opened 3 years ago

TheDcoder commented 3 years ago

Hi,

First of all, thanks for making the extension, it is useful.

I am not sure about the nature of the bug, but here is what I did:

  1. Install the extension
  2. Set up encryption for my admin account
  3. Login into a test account in private Firefox window
  4. Click the "Start Conversation" button

There is no prompt to enter the password, it just takes me to the "Enter username" field. Trying to start a conversation with my admin account results in this JS error:

Uncaught (in promise) TypeError: _0x32ee24 is undefined
    _0x4dd4d0 forum-8871fddf.js:513
    create forum-8871fddf.js:513
    async* forum-8871fddf.js:513
    promise callback* forum-8871fddf.js:513
    promise callback* forum-8871fddf.js:513
    promise callback* forum-8871fddf.js:513
    promise callback* forum-8871fddf.js:513
    promise callback* forum-8871fddf.js:513
    handleEvent render.js:888

I assume _0x32ee24 is the object holding the encryption key. By the way, why is some of the source code obfuscated in your repository? I tried to track down the bug but couldn't because of that.

KyrneDev commented 3 years ago

Firefox private tabs don't allow access to the indexed db, which is required. This isn't a shout issue it's a Firefox issue.

https://bugzilla.mozilla.org/show_bug.cgi?id=1639542

it should be fixed in the next version of Firefox, maybe.

TheDcoder commented 3 years ago

Interesting, the Firefox bug is very old (~10 years), good to see that they are finally making some progress.

However, we should add some kind of warning message to the UI when IDB isn't available, maybe even messaging can be enabled for use, but without storage.

KyrneDev commented 3 years ago

I can probably just store the data somewhere else if the indexed dB isn't available.

The data isn't for the messages, I can just store those in Flarum's data. It's the encryption keys that need to persist and be relatively secure.

TheDcoder commented 3 years ago

In that case, web storage might be a better option.