OAuth registration and login
OAuth refactoring and bugfix