Closed avee87 closed 4 months ago
Some observations:
tokens
/ profiles
and with a jsonb
column like settings/preferences
which will hold all user key/value pairs. getEmpty()
). Need to hold a single source of truth.ui
path to the pinia store // Before
this.ui.darkTheme = newValues.darkTheme
this.ui.numberFormat = newValues.numberFormat
// After
for (let key as Object.keys(newValues)) {
this.ui[key] = newValues[key]
}
Nice! Already looks way better. A few more observations:
GET /api/profiles/<hash>
the new endpoints should be REST like: GET /api/profiles/\
It’s not hash, it’s full access token which is insanely long. I’m not sure it’s a good idea to pass it as part of the path.
Indeed. Then I guess we can just remove it, have the route as GET /api/profiles
and read the token from the Authorization header.
Also in the new DB migration let's create a primary key "id" to future proof it. This way we can later turn it into a classic REST approach (ex. Let the user manage multiple profile settings)
Awesome contribution! 🚀 ❤️
Exploring implementation for #31 For now just for UI settings such as dark mode and lowercasing things.
Settings are keyed on app token but I also hash it to prevent storing it in database as is.