txAdmin icon indicating copy to clipboard operation
txAdmin copied to clipboard

[BUG] Blank iframe page after updating admins.

Open VIRUXE opened this issue 3 years ago • 1 comments

txAdmin/FXServer versions: image

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 image

VIRUXE avatar Dec 26 '21 20:12 VIRUXE

@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.

network

TasoOneAsia avatar Dec 28 '21 01:12 TasoOneAsia

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. image
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?

tabarra avatar Mar 13 '23 11:03 tabarra

This has been solved either in txAdmin v7.0.0 or in cd469915250da090e57919bba8d4b4cf9d64ad13.

tabarra avatar Feb 25 '24 05:02 tabarra