Skip to content

API Returning Unathorized #3109

@TiborUdvari

Description

@TiborUdvari

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

curl --location 'https://editor.p5js.org/api/v1/auth/access-check/' \
--header 'Authorization: Basic TOKEN '

Or axios:

const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://editor.p5js.org/api/v1/auth/access-check/',
  headers: { 
    'Authorization': 'Basic TOKEN'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behaviors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions