Some logic for logging/creating user.