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

Fetch Documents Error when no cookies provided #14

Closed
yui0303 opened this issue May 30, 2024 · 3 comments · Fixed by #23
Closed

Fetch Documents Error when no cookies provided #14

yui0303 opened this issue May 30, 2024 · 3 comments · Fixed by #23
Assignees
Labels
bug Something isn't working

Comments

@yui0303
Copy link
Collaborator

yui0303 commented May 30, 2024

Curl did not carry the cookie when http/https request in default. But still can fetch the data.

Reproduce

  1. Direct use curl in terminal
  2. Test the following api

/api/users : Can get the users directly
/api/documents/me: {"statusCode":500,"message":"Internal server error"}. Perhaps server got the empty user
/api/comments: {"data":[],"page":1,"limit":10,"total":0}

image

@yui0303 yui0303 added the bug Something isn't working label May 30, 2024
@grace0950
Copy link
Collaborator

If you do not carry the access_token, you do not have permission to access /documents/me. However, you are allowed to view public documents, so it is normal to encounter an error. I have now changed it to return a 401 Unauthorized status code.

@YJack0000
Copy link
Owner

SGTM! Then tag the commit and close the issue.

@grace0950
Copy link
Collaborator

Update at #23

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

Successfully merging a pull request may close this issue.

5 participants