- Update database schema to rename `UserFav` to `LogtoUserFav` with clearer field names (`logto_uid`, `kaiqiu_uid`). - Bump `jose` dependency to v6.2.1 for improved JWT verification. - Configure `@logto/react` to request the correct resource token for API access. - Implement token verification on the server side using `jose` and `jwtVerify`. - Update API routes (`/api/fav`) to extract the user ID from the verified JWT `sub` claim instead of the URL `aud` parameter. - Refactor frontend components (`FavButton`, `FavePlayersPage`) to use `useAuthHeaders` for fetching auth headers instead of manual token claims extraction. - Clean up unused migration and DAO functions related to the old `aud`-based logic.
8 lines
229 B
SQL
8 lines
229 B
SQL
-- CreateTable
|
|
CREATE TABLE `LogtoUserFav` (
|
|
`logto_uid` VARCHAR(191) NOT NULL,
|
|
`kaiqiu_uid` VARCHAR(191) NOT NULL,
|
|
|
|
PRIMARY KEY (`logto_uid`, `kaiqiu_uid`)
|
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|