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
Summary
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
Mar 15, 2024, 20:38
You're not logged in. Browsing to that url is probably using your console cookie.
Ivan
Rank 3: Container
Mar 15, 2024, 20:40
yea i know i am not so i show the user a login page, which seems to not work..
Ivan
Rank 3: Container
Mar 15, 2024, 20:40
am I logging in the user correctly..?
Steven
Mar 15, 2024, 20:42
Sorry I don't understand the problem
Ivan
Rank 3: Container
Mar 15, 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
Mar 15, 2024, 20:45
What are all the network calls on the page from the browser dev tools?
Ivan
Rank 3: Container
Mar 15, 2024, 20:47
Ivan
Rank 3: Container
Mar 15, 2024, 20:47
this?
Ivan
Rank 3: Container
Mar 15, 2024, 20:48
red one:
Steven
Mar 15, 2024, 20:48
Ok...you're not logged in so you see this error. That's expected isn't it?
Ivan
Rank 3: Container
Mar 15, 2024, 20:48
yes
Steven
Mar 15, 2024, 20:48
Ok and...
Ivan
Rank 3: Container
Mar 15, 2024, 20:49
thats how the function works (subscription with stripe template)
You said it's behaving as expected so what is the problem?
Ivan
Rank 3: Container
Mar 15, 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
Rank 3: Container
Mar 15, 2024, 20:57
I am asking If i am doing the login part wrong or something else?
Ivan
Rank 3: Container
Mar 15, 2024, 20:58
Cant get login on web or get account
Steven
Mar 15, 2024, 20:58
Please share all the network logs
Ivan
Rank 3: Container
Mar 15, 2024, 20:59
I did, everything above is what I got in the console