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

Example code doesn't work as is #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bloveless
Copy link

@bloveless bloveless commented Sep 27, 2020

Issue

Update example code to work this seems to be a duplicate of #75 probably just consider that PR instead of this one.

Error

/home/node/app/node_modules/express-oauth-server/index.js:25
this.useErrorHandler = options.useErrorHandler ? true : false;
                                    ^

TypeError: Cannot set property 'useErrorHandler' of undefined
    at ExpressOAuthServer (/home/node/app/node_modules/express-oauth-server/index.js:25:24)
    at Object.<anonymous> (/home/node/app/index.js:14:13)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:941:32)
    at Function.Module._load (internal/modules/cjs/loader.js:782:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

Fix

In order to fix this example adding new to the oauthServer call allows the use of this within the constructor.

Update example code to work
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

Successfully merging this pull request may close these issues.

1 participant