Registering User in Atlas Functions

We are registering a new user from our website & app via an Atlas Function using:

https://realm.mongodb.com/api/admin/v3.0/groups/GROUP_ID/apps/APP_ID/users
      method: 'POST',
      headers: {
        'Accept': 'application.json',
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${access_token}`
      },
      body: JSON.stringify({"email": userEmail, "password": userRandomPassword})
    });

However this requires that every time we run the function we must get the Atlas Access Token first by making a request to:

https://realm.mongodb.com/api/admin/v3.0/auth/providers/mongodb-cloud/login

Which is quite a heavy lot of code to simply register a user, and is really slow.

Questions:

  1. Is there a faster/simpler way of doing this?
  2. Shouldn’t Atlas Functions have permissions to make a request to Atlas API?
  3. Is is possilbe to run realm-web in Atlas Functions?

Thanks!