Fix handling of after auth redir URL value so it gets properly respected as stated in the GUI. Fixes #11842
Fix up and optimize the redirect code in general, there were several ordering issues (using values before they were set), logic problems, etc. Issue #11842
Validate the redirect URL on save and again before attempting to use it, that way values which are not URLs do not make their way to clients and cause errors or unintended behavior in the browser. Fixes #11843
Related issues
Bug #11842: Captive Portal post-auth redirect is not properly respected
Bug #11843: Potential XSS vulnerability in Captive Portal ``redirurl`` handling
Improve Captive Portal redirect URL handling.
respected as stated in the GUI. Fixes #11842
ordering issues (using values before they were set), logic problems,
etc. Issue #11842
it, that way values which are not URLs do not make their way to clients
and cause errors or unintended behavior in the browser. Fixes #11843