epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.37k stars 357 forks source link

Wrong constructor options on GitHubStrategy? #819

Open WebCloud opened 1 month ago

WebCloud commented 1 month ago

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.

kentcdodds commented 1 month ago

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

WebCloud commented 1 month ago

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