Trying to update assignment: Cannot verify CSRF Token Authenticity #195399
Replies: 11 comments 24 replies
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hello @fuhrmanator! Since your lab starts this Wednesday, I understand the urgency. Looking closely at your console logs (TypeError: Cannot read properties of null (reading 'dataset')), this appears to be a frontend regression/bug on GitHub Classroom's side affecting how the form renders the repository visibility or the slug field. The "CSRF Token" error is likely a secondary failure because the broken JavaScript prevents the form from submitting correctly. While waiting for GitHub staff to deploy a fix, you need a workaround to get your assignments ready. Please try these steps: Bypass the Buggy UI (The Duplication Workaround): Instead of updating an existing assignment where the UI crashes, try creating a completely new assignment. Sometimes, the bug only triggers on the 'Edit/Update' page of older assignment templates. Use the GitHub Classroom CLI: Install the CLI. You can often clone, create, or manage assignments directly from your terminal, which bypasses these JavaScript/CSRF web errors. Hard Reload & Different Browser: I hope one of these workarounds allows you to set up the cutoff date for your Wednesday lab! Please let us know if any of these methods successfully bypass the error. |
Beta Was this translation helpful? Give feedback.
-
|
I am currently unable to configure a GitHub Classroom assignment correctly because saving changes to the assignment fails with:
This blocks an important assignment setting:
What I triedI tried to create a new assignment from a template repository that contains multiple branches. During assignment creation, I could not find or set the “Copy the default branch only” option properly. After creating the assignment, I tried to edit/update the assignment to disable “Copy the default branch only”, because I need all branches from the template repository to be copied into the student repositories. However, saving the updated assignment always fails with:
Expected behaviorI should be able to either:
When the option is disabled, newly created student repositories should include all branches from the template repository. Actual behaviorThe assignment appears to be created with only the default branch copied. When I try to update the assignment afterwards, saving fails with the CSRF token error. As a result, I cannot change the assignment setting and cannot create student repositories with all branches included. Why this is a serious problemThis is a blocking issue for teaching scenarios where the template repository intentionally contains several branches, for example:
In my case, the missing branches are part of the assignment design. The workaround of manually pushing branches into every student repository is possible, but very cumbersome and error-prone. Environment / context
Could someone from the GitHub Classroom team please confirm whether this is a known regression and whether there is a workaround or ETA for a fix? |
Beta Was this translation helpful? Give feedback.
-
|
Same problem here... |
Beta Was this translation helpful? Give feedback.
-
|
Same issue. This makes GitHub classroom challenging to use properly (along with other issues like the "Repo not found" nonsense that happens CONSTANTLY) and it seems like the GitHub team doesn't really pay much attention to it. Very disappointing, because the concept and general functionality is a great idea. Is GitHub Classroom still being maintained or is it just abandonware? |
Beta Was this translation helpful? Give feedback.
-
|
same issue. The assignment is active. trying to add the cutoff date and time. But couldn't update... |
Beta Was this translation helpful? Give feedback.
-
|
The error “Cannot verify CSRF Token Authenticity” usually happens in backend frameworks when the CSRF token is missing, expired, or invalid.
Sometimes the session/token expires.
Old session cookies often cause this.
Creates a fresh CSRF token. Make sure the CSRF token exists inside the form. |
Beta Was this translation helpful? Give feedback.
-
|
Well, you can try this. perhaps it will work. Log out of GitHub completely. If still broken, revoke and reconnect GitHub Classroom access: Finally, create a new assignment instead of editing the old one (this fixes many CSRF issues). Official pages: |
Beta Was this translation helpful? Give feedback.
-
|
Looks like a CSRF/session cache issue in GitHub Classroom try re-login or an incognito window and see if the slug edit works again; when troubleshooting setups I also use contador de horas to keep track of time spent on fixes and configuration. |
Beta Was this translation helpful? Give feedback.
-
|
The console errors make this look like a GitHub Classroom frontend regression, not a normal CSRF/session mistake. A normal CSRF issue is usually fixed by signing out/in or clearing cookies. In your case, the page is throwing JavaScript errors before the form works: That strongly suggests the assignment edit page is expecting a DOM element that is missing for this assignment state. The CSRF error is probably a secondary symptom because the form submit/update flow is broken after the JS crash. GitHub Classroom docs confirm assignments are supposed to be editable from the Classroom UI, and GitHub CLI can list/view/clone Classroom assignments, but the CLI does not appear to provide a full replacement for editing every assignment setting such as cutoff dates or template branch-copy behavior. Docs:
Practical workaround while waiting for GitHub:
For GitHub staff, I would add a minimized report with:
Because multiple instructors are now seeing this, it would help to state whether this started on existing assignments only or also brand-new assignments. |
Beta Was this translation helpful? Give feedback.
-
|
+1 Error still exists. I cannot edit the titles of assignments to match new naming convention for my courses. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
GitHub Classroom
Hi everyone,
I use GitHub Classroom every summer and I'm trying to set up a new assignment as I always do. EDIT: I don't use the "reuse assignment" feature since it caused headaches in the past. I only use Classroom once a year during summer.
Cannot verify CSRF Token AuthenticitySomething seems to be broken. Any help would be appreciated.
ETA:
When I load the assignment page there are errors in the console:
For privacy reasons I didn't want to paste the assignment URL of the assignment.
Beta Was this translation helpful? Give feedback.
All reactions