Hi!
I’m trying to use netlify-auth-providers
to get a GitHub Token to use the GitHub API.
const authenticator = new netlify({
site_id: "$mySiteId",
});
const authed = await authenticator.authenticate(
{ provider: "github", scope: "user" },
async (error, data) => {
if (error) {
return error;
}
return data;
}
);
console.log({ authed }); // returns undefined
This works fine when deployed to Netlify, but I can’t get it to work for my local dev environment.
I’m using the netlify dev server to start my project:
$ netlify dev --live
When trying to authenticate, the netlify popup opens, and tells me that I’m authenticated, but the function always returns undefined. I’m expecting to get a GitHub token in data
.
Is there something I’m missing? What do I need to do in order to authenticate (or mock an authentication) locally?
The app is deployed at apfelmark.netlify.app