Logout bug after entering credentials

Describe the problem/error/question

After I give n8n permissions to my google account - does not matter weather I do this in the self hosted or claud version - n8n logs me out. I do not see I am logged out right away though. I can keep editing the workflow, but as soon as I save it/refresh the page, I am back and the login screen with nothing having been applyed.

Please share your workflow

Its not workflow related, it happens whenever I give n8n the permission to my google account.

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.13.4
  • Database (default: SQLite): SQLite, did not configure something else, so it has to be that one
  • n8n EXECUTIONS_PROCESS setting (default: own, main): same here
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm on a VPS
  • Operating system: Windows Server

Not sure if I understand what is happening.
Can u share some screenshots or a quick video showing what the issue is?

Pretty sure this is the OAuth redirect dropping your session cookie. If your behind a reverse proxy try setting N8N_SECURE_COOKIE=false in your env vars, that tends to fix it on non-https setups.

That would not make sense if it is the same issue on n8n Cloud..

@pvdyck
I am not behind a reverse proxy, I am just connecting to my vps.

@BramKn

I even just had a bug where no workflows at all where visible, the entire list was completely blank.

Since its all on my vps I am unable to screenrecord it from my pc.

What happens is:

I go to my Gmail node > enter the credentials > get access > work on the rest of my workflow > as soon as I want to leave the page, I get asked weather I want to save or not, no matter which option I pick, I get redirected to the login screen > If I log back in, the workflow is as it was before.

Right now it does not seem to happen anymore, gonna wake this thread up as soon as I notice it again, have not been working with n8n for a few days.

1 Like

not sure about this one but we hit something similar with self-hosted setups when there was a reverse proxy — sounds like a cookie/session thing. are you behind nginx or similar?

sounds like a session/cookie issue tied to the OAuth redirect, not the Google auth itself since you’re seeing it on n8n cloud too. the N8N_SECURE_COOKIE suggestion is good for self-hosted, but if it’s also happening on cloud it might be a browser-level cookie domain mismatch. try clearing cookies for both n8n and google.accounts.com and see if it reproducible?