Open dcaslin opened 2 years ago
The same applies to SvelteKit v1.0.0-next.195
... Here I'm not explicitly using fetch
, it seems to be done by the library itself.
The problem also appears when trying to log in with username/email and password...
Tried explicitly using both node-fetch
and cross-fetch within lib itself w/o success...
Also for the use case of localhost it works perfectly...
But adding host
parameter to SvelteKitAuth
constructor gives fetch is not defined
.
And if you don't setup host parameter your production build may not set an HTTPS redirection URI.
Looks like the oauth2.ts is using native fetch:
const res = await fetch(this.config.accessTokenUrl!, {
From what I've read, this won't work in SSR Sveltekit code, where we'd need to explicitly use node-fetch or pass through the sveltekit supplied "fetch". FWIW this is in sveltekit 1.0.0-next.165