fix login/authorization stuff, is much cleaner now