Back

Cant get login on web or get account

  • 1
  • Self Hosted
  • Auth
  • Web
  • Functions
Ivan
15 Mar, 2024, 20:25

Hello, I am modifying the stripe subscriptions template to include the login page, I always run into AppwriteException: User (role: guests) missing scope (account) even though visiting the domain/v1/account shows the json of the active session. My full code of the index.html is bellow (everything else is unchanged). (first domain (ssteh.beyond...) is for sever hosting, and the second one (premium.ssteh.com) is domain of the function (hosted on the same server) Also already registered a web app in the console

TL;DR
Developers are encountering issues logging in and retrieving account information in a web application. The problem seems to involve incorrect user login functionality causing a redirection loop to the login page. It's advised to check network calls in the browser dev tools and ensure accurate user authentication methods are being implemented. The error message suggests a missing scope issue with the account. Make sure to verify the login functionality and ensure correct API calls to avoid redirection problems. Solution: Double-check the login functionality and API calls to troubleshoot the redirection loop and potential scope issues with the account.
Steven
15 Mar, 2024, 20:38

You're not logged in. Browsing to that url is probably using your console cookie.

Ivan
15 Mar, 2024, 20:40

yea i know i am not so i show the user a login page, which seems to not work..

Ivan
15 Mar, 2024, 20:40

am I logging in the user correctly..?

Steven
15 Mar, 2024, 20:42

Sorry I don't understand the problem

Ivan
15 Mar, 2024, 20:43

if the user is not logged in they get shown a login page, to enter email and password, but after clicking login I get redirected back to the login page, still with the error above

Steven
15 Mar, 2024, 20:45

What are all the network calls on the page from the browser dev tools?

Ivan
15 Mar, 2024, 20:47
Ivan
15 Mar, 2024, 20:47

this?

Ivan
15 Mar, 2024, 20:48

red one:

Steven
15 Mar, 2024, 20:48

Ok...you're not logged in so you see this error. That's expected isn't it?

Ivan
15 Mar, 2024, 20:48

yes

Steven
15 Mar, 2024, 20:48

Ok and...

Ivan
15 Mar, 2024, 20:49

thats how the function works (subscription with stripe template)

Steven
15 Mar, 2024, 20:50

What?

Steven
15 Mar, 2024, 20:55

You said it's behaving as expected so what is the problem?

Ivan
15 Mar, 2024, 20:56

problem is when I try to log in (enter credentials) it returns be back to the login page insted of the /subscribe, because it cant gets the account info via the account.get()

Ivan
15 Mar, 2024, 20:57

I am asking If i am doing the login part wrong or something else?

Ivan
15 Mar, 2024, 20:58

Cant get login on web or get account

Steven
15 Mar, 2024, 20:58

Please share all the network logs

Ivan
15 Mar, 2024, 20:59

I did, everything above is what I got in the console

Steven
15 Mar, 2024, 20:59

There is no log in call

Ivan
15 Mar, 2024, 20:59

the console.log you mean?

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