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

[v1.17.0] API cannot use _csrf token get information #20585

Closed
tyroneyeh opened this issue Aug 1, 2022 · 2 comments
Closed

[v1.17.0] API cannot use _csrf token get information #20585

tyroneyeh opened this issue Aug 1, 2022 · 2 comments
Labels
modifies/api This PR adds API routes or modifies them type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@tyroneyeh
Copy link
Contributor

tyroneyeh commented Aug 1, 2022

Description

Show The target couldn't be found. or token is required
How use _csrf token to API get data?

API URL: /api/v1/repos/{username}/{reponame}/issues this API in mustEnableIssuesOrPulls function show The target couldn't be found.

API URL: /api/v1/notifications this API show token is required

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

systemd

Database

PostgreSQL

@lunny
Copy link
Member

lunny commented Aug 1, 2022

From v1.17, web requests are splitter from API/v1. API will not need csrf token. You could just use access token to do that.

@tyroneyeh
Copy link
Contributor Author

Is it possible to use the session that the original browser is logged in to access the API data?, using AJAX

@noerw noerw added type/question Issue needs no code to be fixed, only a description on how to fix it yourself. modifies/api This PR adds API routes or modifies them and removed type/bug labels Aug 1, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants