nazrinharris / pecunia

Massively ambitious personal finance app.
1 stars 0 forks source link

Update `savedUsers` to store `PecuniaUser` rather than just the username #155

Closed nazrinharris closed 8 months ago

nazrinharris commented 8 months ago

To concretely define it, savedUsers are merely meant as a record of users which have previously logged in on the device, and their transactions database still exists.

I don't need nor would want to store the entire user data into savedUsers as it shouldn't be a "source of truth" per say, merely a collection.

I think just storing PecuniaUser would make things much simpler. More specifically, I'd be storing it like such:

<uid> : <PecuniaUser as JSON>

I'm not really sure what I'm worried about with storing PecuniaUser. It's not like I'm putting critical data in the PecuniaUser object.

If there's any change to PecuniaUser (user changes email, username, etc.) then this record simply needs to be updated.)

But then, I did make a mistake of storing the username, which in the authentication scheme of things, is quite useless as I primarily use and intend to use emails for identification, aside from the uid.

^ (I don't know what I was yapping about)

Deed

nazrinharris commented 8 months ago

With this, the user would need to relog to update the list. And I since I can pretty easily differentiate between the old and new way of storing in savedUsers, I can clearly show a message indicating that said users must relog.

nazrinharris commented 8 months ago

Should be completed with a974c23 in #132