-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
allow api endpoint '/api/v1/auth/tokens/register' to answer json requests with json response #5040
base: master
Are you sure you want to change the base?
Conversation
119abbf
to
75b49d4
Compare
sorry for the squash spam, but i realized after the fact that my assumptions were wrong, i think that should be enough |
and now i'm wondering if that is, in fact, worse... |
…ests with json response
Hello, if your PR is not finished yet you can convert it to a draft. |
Hi, |
If you look at the code, it returns HTML because you have a session ID present in the current environment ( Are you trying to access that API endpoint from a browser where you're already logged in? |
no, that's the point, i'm trying to acces the api from a python script but i don't have a token yet, so i log in by posting a username/password (i couldn't find any documentation on how to login differently) then try to generate the token i would like to use for the rest of the session (mainly retrieving user feed). the whole thing look like (pseudo-code):
and given that my second request is a json one i would expect the json api to return the same. |
correct me if i'm wrong, but, I do need to be logged in to use all the 'api/v1/auth' endoints, right? |
also i forgot to mention but the idea is to store only the tokens (per instance) not the user/pass... |
currently '/api/v1/auth/tokens/register' returns html even if the request is a json one when you register your first token (meaning there is no authorization header yet)