Auth based on querystring and some cleanup with login check.