code: def account_setup(remote, token=None, response=None,
                    account_setup=None):
      
      gh = GitHubAPI(user_id=token.remote_account.user_id)
      with db.session.begin_nested():
          gh.init_account()
  
          # Create user <-> external id link.
          oauth_link_external_id(
              token.remote_account.user,
              dict(id=str(gh.account.extra_data['id']), method="github")
          )
docs: Setup user account.