txAdmin
txAdmin copied to clipboard
[BUG] Blank iframe page after updating admins.
txAdmin/FXServer versions:
Describe the bug I updated the Discord ID on one of my admins via the in-game ui and the page went blank after submit.
Expected behavior Return to the admin list?
Screenshots
@tabarra I can confirm that this bug does occur whenever updating any type of admin from the iframe, as updating admins will clear the server side table used to authenticate any WebPipe requests, resulting in the request failing with a 403 before the reauthentication process can complete.
I confirmed the bug and tried to solve, but couldn't.
This is not just for admin manager, but any page after any admin is modified.
The solution is for whenever the NUI receive the resetSession
message (handled on nui\src\hooks\useNuiListenersService.tsx
) and is on the iframe page, to change the iframe url to /nui/start/adminManager?refresh
.
My attempt did not work because apparently i cannot use a useContext inside a hook.
Ideally the user would be redirected to something like /nui/start?oldPath=whatever
and tx core would re-auth then redirect the user back to the old path, but for now redirecting to the admin manager is enough.
Preferably just check if it is on the admin manager page, redirect to /nui/start/adminManager?refresh
otherwise redirect to /nui/start?refresh
.
@TasoOneAsia Can you please have a look at it?
This has been solved either in txAdmin v7.0.0 or in cd469915250da090e57919bba8d4b4cf9d64ad13.