Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

419 - Page Expired CSRF token mismatch #827

Closed
rwario opened this issue Jul 16, 2024 · 11 comments
Closed

419 - Page Expired CSRF token mismatch #827

rwario opened this issue Jul 16, 2024 · 11 comments
Labels
Bug Something isn't working

Comments

@rwario
Copy link

rwario commented Jul 16, 2024

Bug Description

I installed the linke ace docker for my unraid server and it was working very well and i imported all my bookmarks. This morning i was logged out and tried to log in again getting this error:

419 - Page Expired
CSRF token mismatch

And cant login anymore (tried different browsers, cleaned cache etc.). How do i fix this problem? If not how can i save my bookmarks?

How to reproduce

  1. Go to Browser ex. Brave, Firefox etc.
  2. Open Server Linke Ace IP
  3. Enter Login Credentials
  4. Get the 419 Page Expired error (CSRF Token mismatch)

Expected behavior

Working login into the bookmark page.

Logs

No response

Screenshots

 LinkAce Login error

LinkAce version

v1.15.0

Setup Method

Docker

Operating System

other (please specify in description)

Client details

Unraid 6.12.10, Browser Brave

@rwario rwario added the Bug Something isn't working label Jul 16, 2024
@Kovah
Copy link
Owner

Kovah commented Jul 16, 2024

Please try to run php artisan config:clear and php artisan cache:clear in the LinkAce Docker container.

Also, did you modify any variables in the .env file besides database passwords?

@rwario
Copy link
Author

rwario commented Jul 17, 2024

Nope the commands did not change anything still showing the same mismatch error. I have not changed anything besides the needed database data in the .env file.

But i have found in Maria DB LOG following info :

An upgrade is required on your databases.
Stop any services that are accessing databases
in this container, and then run the command
mariadb-upgrade -u root -p PASSWORD

I will try to run this command and report back if this fixed the issue.

Update: The Database Upgrade did not change anything, still showing the same error.

@Kovah
Copy link
Owner

Kovah commented Jul 17, 2024

Could you please share more details about your setup:

  • the URL you use to access LinkAce
  • which web server is in front of LinkAce, how does the configuration look like?
  • are you using any browser extension that might interfere with LinkAce? In Brave, make sure that the website protection is turned off to test this.
  • when opening linkace, what exactly happens, where are you redirected to?
  • if you try to login, please check if said CSRF token is present and generated. Your login form should look similar to this:
    login form

@imloic
Copy link

imloic commented Jul 18, 2024

I had the same problem myself. I solved the problem by editing the .env file in this way:

SESSION_SECURE_COOKIE=false

@rwario
Copy link
Author

rwario commented Jul 19, 2024

SESSION_SECURE_COOKIE=false

Thanks imloic! That did the trick its working again. Danke auch Kovah!

@ani-6
Copy link

ani-6 commented Jul 26, 2024

I am facing same issue with version v1.15.1. Using firefox.
I am able to see CSRF token generated.
image

@Kovah
Copy link
Owner

Kovah commented Jul 28, 2024

@ani-6 have you tried the suggested fix?

@ani-6
Copy link

ani-6 commented Aug 1, 2024

Yup its working fine with SESSION_SECURE_COOKIE=false

@BamButz
Copy link

BamButz commented Aug 2, 2024

It seems that everything is working fine. Maybe it should be documented, that if you access the app via HTTP (and not HTTPS) you have to set that environment variable.

@Daivy03
Copy link

Daivy03 commented Aug 4, 2024

Same issue, resolved adding the nginx config to my reverse proxy:
https://www.linkace.org/docs/v1/setup/setup-with-docker/advanced-configuration/

@Kovah
Copy link
Owner

Kovah commented Aug 15, 2024

This should basically be fixed with the latest version 1.15.2. The latest change causing this issue was reverted.

@Kovah Kovah closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants