Skip to content

Commit 217d286

Browse files
committed
routes: layout: Adjust field with new API
A bit breaking change, all user info is now stored at "user_info" field. Before: ``` { "code": 200, "res": { "id": 2, "full_name": "Ammar Faizi", "gender": "m", "username": "ammarfaizi2", "role": "user", "is_active": "1", "renew_token": { "token": "...", "token_exp_at": 1741842452 } } } ``` After: ``` { "code": 200, "res": { "user_info": { "id": 2, "full_name": "Ammar Faizi", "gender": "m", "username": "ammarfaizi2", "ext_email": "[email protected]", "role": "user", "is_active": "1", "socials": { "github_username": "ammarfaizi2", "telegram_username": "ammarfaizi2", "twitter_username": "ammarfaizi2", "discord_username": "ammarfaizi2" }, "photo": null }, "renew_token": { "token": "...", "token_exp_at": 1741842452 } } } ``` Signed-off-by: Ammar Faizi <[email protected]>
1 parent e915aba commit 217d286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/(protected)/+layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export const load: LayoutLoad = async () => {
1616
params: { action: "get_user_info" }
1717
});
1818

19-
localStorage.setItem("gwm_uinfo", JSON.stringify(data.res));
19+
localStorage.setItem("gwm_uinfo", JSON.stringify(data.res.user_info));
2020
auth.refresh();
2121
};

0 commit comments

Comments
 (0)