epic-stack
epic-stack copied to clipboard
Wrong constructor options on GitHubStrategy?
Whist setting up my own app I've stumbled upon an error:
TypeError: Cannot read properties of undefined (reading 'toString')
at GitHubStrategy.authenticate (file:///home/webcloud/code/perflab-frontend/node_modules/remix-auth-oauth2/src/index.ts:178:61)
Originating from https://github.com/epicweb-dev/epic-stack/blob/f1fd16da59a648e0755e1c6e5c136d05c7a78e48/app/utils/providers/github.server.ts#L31-L33
This seem to be refering to a missing constructor args: https://github.com/sergiodxa/remix-auth-oauth2/blob/main/src/index.ts#L178
AFter changin the callbackURL to redirectURI it threw a new error:
cause: OAuth2Error: redirect_uri_mismatch
Which seemed to be related to the initially configured URL on the OAuth app. After changing and matching those I got a 404 since the clientId option is wrongly called clientID.
with those fixes I was able to finally get the GH OAuth login prompt, but got an error about a missing expires_in field.
Hard to say since login works with the deployed version of the template: https://www.epicstack.dev
Interesting. I'll give it another shot and see. I thought I followed the doc properly but I might have missed on something then
add some similar issue while using pnpm but not on npm
I also encountered the issue. It resulted from a breaking change of remix-auth-github between version 1.7.0 and 1.8.0. After switching back to 1.7.0, everything worked as expected.
Interesting comment by @Kampouse as I also used pnpm initially, but later converted back to npm. Maybe that is the common factor here. I''ll later also try testing moving it back to 1.7.0. I'm now focused on other stuff and won't be testing this anytime soon I'm affraid.
Maybe we can close this one and await to see if more ppl struggle with this @kentcdodds
Yep 👍