vocdoni / ui-components

Vocdoni UI components libs
GNU General Public License v3.0
3 stars 2 forks source link

Retrieve nullifier when accessing anonymous votings #108

Closed elboletaire closed 9 months ago

elboletaire commented 11 months ago

Note: I'm not sure about the terminologies used in this issue, and they may change in the future when the SDK updates the related flow methods.

Anonymous elections are kinda special, since they have an additional security layer with a custom password, known as SIK.

Due to this layer having a password, and because it is required to get the nullifier (and vote id), anonymous elections should require it, prompting logged in users the very first time they access an anonymous election (such call result should be stored in state to avoid future calls).

Since we'll have to prompt users for their password, the logic of this implementation may be both in react-providers and/or chakra-components

elboletaire commented 9 months ago

There's an issue with the implementation.. the SIK should be checked in the SpreadsheetAccess component, since right now it's not checked and it can cause a bad UX. To check it (copy-pasted from a chat with marcvelmer):

const sik = await AnonymousService.calcSik(address, signature, password)
const checkSik = await await client.anonymousService.fetchAccountSIK(address)

edit: also, the ConfirmModal does not appear for non-anonymous elections now 🙄