epic-stack icon indicating copy to clipboard operation
epic-stack copied to clipboard

Wrong constructor options on GitHubStrategy?

Open WebCloud opened this issue 1 year ago • 4 comments

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.

WebCloud avatar Aug 10 '24 12:08 WebCloud

Hard to say since login works with the deployed version of the template: https://www.epicstack.dev

kentcdodds avatar Aug 11 '24 01:08 kentcdodds

Interesting. I'll give it another shot and see. I thought I followed the doc properly but I might have missed on something then

WebCloud avatar Aug 11 '24 23:08 WebCloud

add some similar issue while using pnpm but not on npm

Kampouse avatar Sep 17 '24 15:09 Kampouse

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.

pleroux0 avatar Sep 22 '24 02:09 pleroux0

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

WebCloud avatar Oct 06 '24 20:10 WebCloud

Yep 👍

kentcdodds avatar Oct 07 '24 04:10 kentcdodds