-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
API Returning Unathorized #3109
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
Comments
Thanks @TiborUdvari! I think this issue might be related to some of the changes I made to the overall |
I saw it wasn't super well documented, so I was really happy to have it work! I think it's super useful to keep stuff updated. Especially for libraries that should have examples in the source, but should also be quickly testable I think. |
I think this wasn't kept up to date for a bit because there was some discussion about whether to continue developing the API or not due to security concerns! I think due to this though I'm having some difficulty pinpointing what exactly the cause for this was. Would you be able to share your process with getting it to work? |
Hi, So I looked through the source code and the issues, and I saw that ml5 was using this, I thought that it was just something that was not well documented. When looking through the code I saw the section relating to API keys, so I used tampermonkey to add the environment variable and I saw that the UI was there.
I think the button wasn't working to generate a new API key so I sent the request to generate the API key manually: fetch('https://editor.p5js.org/editor/account/api-keys', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
label: 'test'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error)); Then it showed up in the UI. Afterwards I followed the documentation to make the API calls. |
I think I was able to get this working on my end! Are you still running into the same issue? |
I just checked, it works with a new API key that I could generate, thank you very much! |
Uh oh!
There was an error while loading. Please reload this page.
p5.js version
No response
What is your operating system?
None
Web browser and version
No response
Actual Behavior
When I'm sending an API request to the to
/auth/access-check/
I get a 401 unathorized error, and all other API endpoints. This seemed to be working a couple of days ago.For context, I want to keep my sketchbook up to sync with the web editor. I'm working on making a lot of examples at the moment for a library I'm working on, so copy pasting to the editor is very cumbersome for me to keep everything up to date.
https://www.tiborudvari.com/sketchbook
Here is the github repo of my sketchbook:
https://github.com/TiborUdvari/sketchbook/tree/main
And the editor upload script for reference.
https://github.com/TiborUdvari/sketchbook/blob/main/scripts/editorUpload.js
Maybe I should have asked before, but I saw that ml5 was doing a similar thing so I just went ahead and implemented it directly.
Expected Behavior
Get a valid response.
Steps to reproduce
Or axios:
The text was updated successfully, but these errors were encountered: