Fix issue with blank query string in onReject

If there no query string for the filtered the URL, then when redirecting
to a login URI such as "/login" a null query would be added
"/login?null".

This commit changes the onReject method to only include queryString if
it is non null.