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

Invalid CSRF token on v3.0.1 #20

Closed
MrSimonC opened this issue Dec 27, 2022 · 3 comments
Closed

Invalid CSRF token on v3.0.1 #20

MrSimonC opened this issue Dec 27, 2022 · 3 comments

Comments

@MrSimonC
Copy link

Hello. Happy Christmas (or happy holidays)!

Since Todoist.net have deprecated v8 of the API, moving to v9, I've updated from v2.2.2 to v3.0.1.

My code hasn't changed since both versions, but now, every time, I'm receiving Invalid CSRF token:

Screenshot 2022-12-27 at 11 02 26

I've created a test-repo with the simplest code to show the issue:

using Todoist.Net;

var todoistKey = Environment.GetEnvironmentVariable("TODOIST_APIKEY");
var client = new TodoistClient(todoistKey);
var result = await client.Projects.GetAsync(); // errors here: 409 Invalid CSRF token

I hit this error running in the cloud: GitHub code-spaces, Azure functions and Azure Container apps. It's definitely code related.
Can you / someone please pull the repo and check if you get the same thing?

@MrSimonC
Copy link
Author

I've also just ran a hello-world starter test just now from the Getting Started guide on todoist.net and can confirm the curl commands work fine with the same API key I'm using on both sync and rest API endpoints...

@olsh
Copy link
Owner

olsh commented Dec 27, 2022

Hello @MrSimonC

Merry Christmas! 🎅🏻

Yes, they changed the authorization flow recently (v9 worked a couple of days ago).
I will roll out a fix soon. Thank you 👍🏻

@olsh
Copy link
Owner

olsh commented Dec 27, 2022

The issue is fixed in v4.0.0
Thank you! 👍🏻

@olsh olsh closed this as completed Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants