Add LoginController pre-auth

Also put in terminal close deferred.