Hello!
I have an app on which I rely on GitHub OAuth. I am using SvelteKit and netlify-auth-providers.
A month ago, the last time I updated the app’, it used to be working both locally and remotely through the same method;
/**
* Authenticates the user.
*/
public async authenticate(): Promise<string> {
const optToken = await this.tryLocalAuthentication();
if (optToken) {
return optToken;
}
return new Promise((resolve) => this.netlifyAuthenticator.authenticate(
{
provider: "github",
scope: "repo",
},
async (error, data) => {
if (error) {
console.error(error);
throw Error("Could not authenticate through GitHub");
} else {
const token = data?.token;
console.debug("[AUTH] Token acquired: " + token);
this.setLocalStorageToken(token);
await AuthState.setToken(token)
resolve(token as string)
}
}
));
}
With the exception of having to stipulate site_id
on local.
I don’t know if it is related, but yesterday I updated to SvelteKit with the 1.0 breaking changes, updated routes and all dependencies, and now the local authentication does not work anymore.
On Netlify, when I login I get a new window that opens for a small time then I’m authenticated, that’s what I expect to have locally. However when I authenticate on local, I get this window that stays open and nothing happens:
What am I doing wrong?