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

Fix admin API unconditionally requiring CSRF token #17975

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #17898

Since #17204, the admin API has only been available through the web application because of the unconditional requirement to provide a valid CSRF token.

This commit changes it back to null_session, which should make it work both with session-based authentication (provided a CSRF token) and with a bearer token.

Fixes mastodon#17898

Since mastodon#17204, the admin API has only been available through the web
application because of the unconditional requirement to provide a valid CSRF
token.

This commit changes it back to `null_session`, which should make it work
both with session-based authentication (provided a CSRF token) and with a
bearer token.
@ClearlyClaire
Copy link
Contributor Author

I don't think there's a drawback to downgrading protect_from_forgery to null_session, but more opinions on this are welcome.

@Gargron Gargron merged commit 62c6e12 into mastodon:main Apr 6, 2022
kadoshita pushed a commit to kadoshita/mastodon that referenced this pull request Apr 9, 2022
Fixes mastodon#17898

Since mastodon#17204, the admin API has only been available through the web
application because of the unconditional requirement to provide a valid CSRF
token.

This commit changes it back to `null_session`, which should make it work
both with session-based authentication (provided a CSRF token) and with a
bearer token.
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

Successfully merging this pull request may close these issues.

422 when approving pending account via admin API
2 participants