Back

[SOLVED] appwrite error User (role: guests) missing scope (account) while creating a user

  • 0
  • Users
  • Web
  • Realtime
vishwa
29 Dec, 2023, 15:06

Hey I am getting this error whenever i tried to create a user.

TL;DR
The user is encountering an error with the Appwrite platform while trying to create a user. They received a suggestion to use the `account.createEmailSession()` function after creating the account, which apparently solved the issue for them. Other users in the thread suggested checking the Users Limit in the Auth > Security settings and ensuring that the correct package (`appwrite` instead of `node-appwrite`) is being used. The user also mentioned that the error occurs when the account is created but the session is not.
vishwa
29 Dec, 2023, 15:06

appwrite error User (role: guests) missing scope (account) while creating a user. How do i fix it?

ideclon
29 Dec, 2023, 15:08

What's your code?

vishwa
29 Dec, 2023, 15:10

await account.create(ID.unique(),email, password);

ideclon
29 Dec, 2023, 15:21

And this is a frontend JS site?

vishwa
29 Dec, 2023, 15:21

Yes

ideclon
29 Dec, 2023, 15:22

And you're definitely using the appwrite package, not the node-appwrite package?

vishwa
29 Dec, 2023, 15:22

Yep sir

ideclon
29 Dec, 2023, 15:24

And you don't have a Users Limit enabled in Auth > Secutiry?

vishwa
29 Dec, 2023, 15:26

this is what happens when i create a user but the account is created but the session is not created

vishwa
29 Dec, 2023, 15:26

yep its in unlimited

ideclon
29 Dec, 2023, 15:30

Oh, right. I don't think a Session is created automatically on user creation? You need to call account.createEmailSession()

vishwa
29 Dec, 2023, 15:31

Oh is it

vishwa
29 Dec, 2023, 15:31

lemme give it a try

vishwa
29 Dec, 2023, 15:33

Nope still getting the same error

ideclon
29 Dec, 2023, 15:35

Ok. What's triggering that error (at LoginCard.jsx line 44)?

vishwa
29 Dec, 2023, 15:40

Hey account.createEmailSession() actually fixed the issue. I just passed the email and password to there after creating the account and now the error is gone

vishwa
29 Dec, 2023, 15:40

thanks a lot

vishwa
29 Dec, 2023, 15:40

: )

ideclon
29 Dec, 2023, 15:42

Great! If your issue has been solved, you can mark this post as closed by adding “[SOLVED]” to the beginning of the title

vishwa
29 Dec, 2023, 15:47

Thanks man

vishwa
29 Dec, 2023, 15:47

Will do

vishwa
29 Dec, 2023, 15:49

[SOLVED] appwrite error User (role: guests) missing scope (account) while creating a user

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more