Skip to content
Back

User (role: guests) missing scope (account)

  • 0
  • Auth
  • Web
  • Storage
  • Cloud
Ambush
13 Nov, 2024, 15:03

Hello, kinda newbie here. I am getting the following errors while trying to create and sign up on my account. I can see the user being created on the appwire site but somehow I am unable to successfully log in. Any idea what may be wrong? I checked out the documentation but I didn't fully understand what I should change to my code. I can provide all the necessary files

TL;DR
Developers are having issues getting users to successfully log in after creating an account on Appwrite. They are unsure where to authenticate the user using Appwrite. The developer should check if the login code is correctly implemented in the sign-up form using Appwrite.
Kenny
13 Nov, 2024, 15:04

What framework are you using? What does your code look like?

Ambush
13 Nov, 2024, 15:07

I am using React and this is how a part of my code from the config.ts looks like

Kenny
13 Nov, 2024, 15:33

what does your login code look like

Ambush
13 Nov, 2024, 15:40

it should be this one, on the sign up form. If there is something else required let me know 😅

Kenny
13 Nov, 2024, 16:03

I guess what i'm asking, where are you using appwrite to authenticate the user.

Ambush
13 Nov, 2024, 16:11

should be this section from api.ts

Kenny
13 Nov, 2024, 16:14

What is on api.ts line 79

Ambush
13 Nov, 2024, 16:15
Kenny
13 Nov, 2024, 16:16

After the user is created you'll need to then create a session for that user. Doing something like this.

TypeScript
const { email, password, name } = user; 

const newAccount = await account.create(
  ID.unique(),
  email,
  password,
  name
);

const newSession = await account.createEmailPasswordSession(email, password);
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