Back

Error during account.get after create session

  • 0
  • Self Hosted
  • Accounts
  • Web
  • REST API
Steven
16 Feb, 2024, 20:27

and the X-Fallback-Cookies cookie is actually missing from the email login POST request.

You mean the response headers?

TL;DR
Summary: The developer is encountering an error during the `account.get` request after creating a session. The `X-Fallback-Cookies` cookie is missing from the email login POST request. The developer is using the self-hosted version 1.4.13 of Appwrite and web SDK version 13.0.1. They have provided a flow explanation and configuration details. Solution: It is suggested to check the configuration of the `_APP_DOMAIN` environment variable. Additionally, the developer should ensure that the server is configured to forward to Appwrite via HTTPS and forward the host header. It is recommended to check the network logs
Fede_
16 Feb, 2024, 20:29

yes, in the response

Fede_
16 Feb, 2024, 20:29

For the frontend app I use appsmith, I don't remember if it uses SSR or CSR

Steven
16 Feb, 2024, 20:30

ok. well the x-fallback-cookies are a fallback anyways...primary place for the session is cookie

Steven
16 Feb, 2024, 20:30

can you check the network logs for the get account api call?

Steven
16 Feb, 2024, 20:31

to see if the cookie is being included?

Fede_
16 Feb, 2024, 20:33

request info and response header

Steven
16 Feb, 2024, 20:34

you might have to switch to the cookies tab

Fede_
16 Feb, 2024, 20:38

under development tools -> Application -> Cookies -> app.domain?

Fede_
16 Feb, 2024, 20:40

under network there's not cookie tab

Steven
16 Feb, 2024, 20:44

btw, with nginx, are you making sure to forward to Appwrite via HTTPS and forward the host header?

Steven
16 Feb, 2024, 20:44

you should 🧐

Fede_
16 Feb, 2024, 20:44

I'll send you the configuration for appwrite

Steven
16 Feb, 2024, 20:45

for the create email session, are you seeing the cookie get returned?

Fede_
16 Feb, 2024, 20:46
TypeScript
server {
        listen 443 ssl;
        server_name auth.domain.com;

        ssl_certificate /etc/nginx/ssl/domain_com_2023.crt;
        ssl_certificate_key /etc/nginx/ssl/domain_com_2023.key;

        location / {

            proxy_pass https://appwrite-traefik/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_buffering off;
            proxy_redirect off;
        }
    }
Steven
16 Feb, 2024, 20:47

kk this should be good

Fede_
16 Feb, 2024, 20:51

email request

Steven
16 Feb, 2024, 20:51

ya...the cookie should be returned....

Fede_
16 Feb, 2024, 20:52

account request

Steven
16 Feb, 2024, 20:55

something is weird with your server/appwrite instance...this should include the set-cookie response header

Fede_
16 Feb, 2024, 20:55

Is there a way to figure out what's wrong?

Steven
16 Feb, 2024, 20:56

Did you configure your _APP_DOMAIN env var?

Fede_
16 Feb, 2024, 20:56

I'm going to check

Fede_
16 Feb, 2024, 20:56

yep

Fede_
16 Feb, 2024, 20:58

but it's strange, because using the frontend app locally and connecting to auth.domain.com everything works correctly, the cookie is passed

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