Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run the application #63

Open
radelphe opened this issue May 2, 2022 · 1 comment
Open

Unable to run the application #63

radelphe opened this issue May 2, 2022 · 1 comment

Comments

@radelphe
Copy link

radelphe commented May 2, 2022

  • I'm submitting a ...
    [ x ] bug report

  • Summary
    I'm not able to run the application. When I ran "yarn start", backend server failed with the following error: TypeError: OAuth2Strategy requires a clientID option. Could you please advise on how to resolve it?

@lyne/backend: waiting-line-app/node_modules/passport-oauth2/lib/strategy.js:87
@lyne/backend:   if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }

@lyne/backend: TypeError: OAuth2Strategy requires a clientID option
@lyne/backend:     at Strategy.OAuth2Strategy (waiting-line-app/node_modules/passport-oauth2/lib/strategy.js:87:34)
@lyne/backend:     at new Strategy (waiting-line-app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
@lyne/backend:     at Object.setupPassport (waiting-line-app/packages/backend/src/lib/passport.ts:53:5)
@lyne/backend:     at Object.createAuthRouter [as default] (waiting-line-app/packages/backend/src/controllers/auth.ts:16:18)
@lyne/backend:     at Object.<anonymous> (waiting-line-app/packages/backend/src/controllers/index.ts:11:37)
@lyne/backend:     at Module._compile (node:internal/modules/cjs/loader:1105:14)
@lyne/backend:     at Module.m._compile (waiting-line-app/node_modules/ts-node/src/index.ts:1455:23)
@lyne/backend:     at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
@lyne/backend:     at Object.require.extensions.<computed> [as .ts] (waiting-line-app/node_modules/ts-node/src/index.ts:1458:12)
@lyne/backend:     at Module.load (node:internal/modules/cjs/loader:981:32)

@jchen42703
Copy link
Owner

  • I'm submitting a ...
    [ x ] bug report

    • Summary
      I'm not able to run the application. When I ran "yarn start", backend server failed with the following error: TypeError: OAuth2Strategy requires a clientID option. Could you please advise on how to resolve it?
@lyne/backend: waiting-line-app/node_modules/passport-oauth2/lib/strategy.js:87
@lyne/backend:   if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }

@lyne/backend: TypeError: OAuth2Strategy requires a clientID option
@lyne/backend:     at Strategy.OAuth2Strategy (waiting-line-app/node_modules/passport-oauth2/lib/strategy.js:87:34)
@lyne/backend:     at new Strategy (waiting-line-app/node_modules/passport-google-oauth20/lib/strategy.js:52:18)
@lyne/backend:     at Object.setupPassport (waiting-line-app/packages/backend/src/lib/passport.ts:53:5)
@lyne/backend:     at Object.createAuthRouter [as default] (waiting-line-app/packages/backend/src/controllers/auth.ts:16:18)
@lyne/backend:     at Object.<anonymous> (waiting-line-app/packages/backend/src/controllers/index.ts:11:37)
@lyne/backend:     at Module._compile (node:internal/modules/cjs/loader:1105:14)
@lyne/backend:     at Module.m._compile (waiting-line-app/node_modules/ts-node/src/index.ts:1455:23)
@lyne/backend:     at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
@lyne/backend:     at Object.require.extensions.<computed> [as .ts] (waiting-line-app/node_modules/ts-node/src/index.ts:1458:12)
@lyne/backend:     at Module.load (node:internal/modules/cjs/loader:981:32)

Sorry for the super late response. The backend requires you to have a .env that should look something like:

LOG_LEVEL=debug

# DB
MONGO_URI=XXXX

GOOGLE_CLIENT_ID="XXXX"
GOOGLE_CLIENT_SECRET="XXXX"
CLIENT_URL="XXX"

# facebook
FACEBOOK_APP_ID="XXX"
FACEBOOK_APP_SECRET="XX"

# cookies
COOKIE_SECRET="XX"
SESSION_COOKIE="XX"
  • the GOOGLE_CLIENT_ID is the OAuth client id. You have to generate it in the Google developer console.
  • the SESSION_COOKIE is strictly used for testing to mock as an authenticated user
  • the FACEBOOK_APP_ID is the FB OAuth app id. You have to generate it in the Facebook developer console.
  • CLIENT_URL is the client callback url to redirect back to. For development, it's http://localhost:3000/dashboard. For prod, you might use something like: https://waitinglyne.org/dashboard
  • COOKIE_SECRET is the private key used to encrypt and decrypt cookies
  • MONGO_URI is the mongodb database URI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants