Back

User role: guests missing scope(account)

  • 0
  • Web
  • Databases
  • Auth
  • General
  • Cloud
chiranjeev
1 Jul, 2024, 13:11

I am unable to implement login signup functionality when the data is sent to the backend it doesn't return the currentUser.I am attaching the bug and the code of the Auth file for reference. It would be of great help if somebody could look into it and find the error. @Dennis Ivy

TL;DR
Developers are experiencing an issue with the guest user role missing scope(account). They are unable to implement login/signup functionality properly as the data sent to the backend does not return the currentUser. They suspect the problem is with the createAccount function and getCurrentUser method. The error being encountered is an appwrite exception of invalid URL. One suggestion is to check the code formatting for better readability.
Kenny
1 Jul, 2024, 13:15

What is not working? Login? Signup?

Kenny
1 Jul, 2024, 13:15

Also you should look into code formatting, having everything left aligned like that makes it far harder to read than if you have it indented and formatted correctly.

chiranjeev
1 Jul, 2024, 13:23

whenever the getCurrentUser() method on the signup page is called it gives an appwrite exception of invalid URL

Kenny
1 Jul, 2024, 13:25

Do you have that error/stack trace, you could post?

chiranjeev
1 Jul, 2024, 13:26

yes sure

chiranjeev
1 Jul, 2024, 13:27
Kenny
1 Jul, 2024, 13:28

Neither of those say invalid URL

chiranjeev
1 Jul, 2024, 13:29

yes sir it is showing missing scope

chiranjeev
1 Jul, 2024, 13:30

I wrote invalid URL by mistake earlier

Kenny
1 Jul, 2024, 13:30

At what point are you called getCurrentUser?

chiranjeev
1 Jul, 2024, 13:31

while sending the signup data to the backend

Kenny
1 Jul, 2024, 13:40

What does userData on line 19 return?

chiranjeev
1 Jul, 2024, 13:51

sir I tried to console it but it is not returning anything. Ideally it should be returning an object with user's data

chiranjeev
1 Jul, 2024, 13:52
Kenny
1 Jul, 2024, 13:53

I think your issue is with the createAccount function. Can you log the output of userAccount on line 15 in auth.js, and log the error in the catch block of that same function

Kenny
1 Jul, 2024, 13:53

and post those

chiranjeev
1 Jul, 2024, 13:56

yes sir

Kenny
1 Jul, 2024, 14:00

I'm not seeing any outputs from either of those logs, is the singup function being called?

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