From 0423190cd2fe476393a535238a61192a0e3f45a2 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Thu, 11 Jan 2024 04:43:57 -0600 Subject: oops forgot to update profile --- src/cmd-launch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cmd-launch.c b/src/cmd-launch.c index 4c445d5..2d44b44 100644 --- a/src/cmd-launch.c +++ b/src/cmd-launch.c @@ -52,6 +52,18 @@ unsigned cmd_launch2(struct l2_context_node *ctx, char **args) CMD_FATAL0("Failed to load user"); } + if (user->session) { + if ((res = l2_user_session_refresh(user->session)) < 0) { + CMD_FATAL0("Failed to refresh your token."); + } else if (!res) { + CMD_FATAL("Could not refresh your token. Interactive login required. Please run `l2su user login %s`.", username); + } + + if (l2_user_update_profile(user) < 0) { + CMD_FATAL0("Failed to update profile"); + } + } + struct l2_launch launch = { 0 }; if (l2_launch_init(&launch, versionname, inst) < 0) { CMD_FATAL0("Failed to initialize launch context"); -- cgit v1.2.3-70-g09d2