#"User (role: guests) missing scope (account)"

5 messages · Page 1 of 1 (latest)

strong isle
#

Hello,

I'm trying to check if my user has an active session but when i used await account.get() i have this error.

I create the session bu phone auth SMS like this:

const client = new Client()
       .setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
      .setProject(process.env.APPWRITE_PROJECT_ID_KEY);

      const account = new Account(client);
      const secretCode = req.bodyJson.secretCode.trim();
      const userId = req.bodyJson.userId.trim();
      const secret = secretCode;

      const session = await account.createSession(userId, secret);

And to check if the user is logged, like this :

const client = new Client()
      .setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT)
      .setProject(process.env.APPWRITE_PROJECT_ID_KEY);

    const account = new Account(client);

    await account.get();
spare monolith
#

I'm trying to do something similar, but using the Python SDK on the server (where the server is the Streamlit backend). I'm also trying to check whether a user has an active session to avoid the user having to log in each time they use the Streamlit app.

slate merlin
#

@strong isle Do you still need hekp with this?

inner plover