Error message in js console on login page

There is a error message thrown out to the js console on the login page, caused by function addAdvancedInfo() in footer.js at this line:

  const XForwardedFor = window.atob(advancedInfoSource.data("xff"));

image

I took a look into that file. There are many functions in there wich are not needed for the login page, even may none of them.

atob expects a base64 encoded string. xff info has been changed latest with Improve reverse proxy handling by DL6ER · Pull Request #2016 · pi-hole/FTL · GitHub

@DL6ER is FTL sending base64 encoded data?

Just to clarify, the mentiond PR is for display the real client's IP address (not just 127.0.0.1) if a reverse proxy is in between.
That's working good, see:

image

Please have a look at that script file, most (if not all) of the functions in there are not needed for the login page.

I think this is caused when xff is null undefined.

We could replace line 717:

with:

const XForwardedFor = window.atob(advancedInfoSource.data("xff") ?? "");

EDIT:
Actually, the issue happens when advancedInfoSource.data("xff") is undefined.

Using the nullish coalescing operator (??) to return an empty string when the variable is undefined fixes the issue.

Maybe some of these values are not needed in the login page, but I think the issue will also happen in other pages if the value of advancedInfoSource.data("xff") is undefined.

No it don't (for a strange reason to be honest) because the data-xff attribute is present after login even without storing a value...

You're right, using the nullish coalescing operator you mentioned would be a fix.