ecency / ecency-mobile

Ecency Mobile - reimagined social blogging, contribute and get rewarded (for Android and iOS)
https://ecency.com
MIT License
232 stars 69 forks source link

Nt/private import fix #2861

Closed noumantahir closed 2 months ago

noumantahir commented 2 months ago

What does this PR?

After testing login routines for some time I finally identified a loophole that most probably causing login data getting corrupted.

Essentially if someone logged in with active or posting key and attempts to import any of keys under Manage Authorities section. What was happening is it overwrites all of private keys to the one imported by user after login.

This matches perfectly with one of reported by a user facing similar issue of being logged in with active but not able to use it yet not being logged out as well.

This is also directly related to pinCode related issue affecting the login data since pinCode is perquisite of managing authorities in app

Steps to reproduce

Login with any key other than master password, import some other key under Manage Authorities

Issue number

Screenshots/Video

BEFORE https://github.com/ecency/ecency-mobile/assets/6298342/a134f7f4-1428-4ce8-a2c8-ef4bec7ea322

AFTER https://github.com/ecency/ecency-mobile/assets/6298342/c5259d66-311d-4f2e-bc4d-4c9752f2e8a6