fix(settings): read the v0.3 username response shape

The v0.3 backend answers GET /users/me/username with {"username": ...};
the legacy backend sent a bare string. The page put the object into state
and rendered it, so /settings threw for every signed-in user.

parseUsernameResponse accepts both shapes and returns only a string or
null. Legacy-only fields on /auth/me are optional. Adds node:test cases,
run with npm test.
This commit is contained in:
2026-11-09 12:44:22 -05:00
committed by John Winter Murphy
parent 0f45143431
commit ecd3cf0ebd
6 changed files with 50 additions and 7 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"test:downloads": "node --experimental-strip-types --test tests/desktop-downloads.test.mjs"
"test:downloads": "node --experimental-strip-types --test tests/desktop-downloads.test.mjs",
"test": "node --test --experimental-strip-types src/lib/*.test.ts"
},
"dependencies": {
"@such-software/smirk-dapp-api": "^0.3.0",