For some reason when I send a request to https://api.glitch.com/boot it seems to send me a 302 HTTP status code. For the current project I’m working on I need to send a request to that URL to receive the gitAccessToken
.
This is the code I have so far.
/**
* Fetch the final `gitAccessToken` from Glitch.
* @param persistentToken The `persistentToken` received after login.
*/
public final (persistentToken: string): Promise<string>
{
return new Promise<string>(async (resolve, reject) => {
try
{
const { data: { user: { gitAccessToken } } } = await Session.API.get(BOOT, { headers: { Authorization: persistentToken } });
resolve(gitAccessToken);
} catch (error)
{
reject(error);
}
});
}
This is the error I receive:
When inspecting the editor when it does the exact same it receives a 200 status code, and also receives the user object with a gitAccessToken property.