passport-oauth2 icon indicating copy to clipboard operation
passport-oauth2 copied to clipboard

Error in strict mode

Open tsabolov opened this issue 9 years ago • 3 comments

I'm on io.js that is run with --use_strict parameter. My script fails with the following error when trying to sign in with google OAuth2:

Error.captureStackTrace(this, arguments.callee);
                                         ^
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
    at new InternalOAuthError (/Users/konstantintsabolov/dev/node-boilerplate/node_modules/passport-google-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/lib/errors/internaloautherror.js:15:42)

As the error said, it's because of accessing arguments.callee in the InternalOAuthError constructor. Do you plan to refactor the code to make it strict-compatible?

tsabolov avatar Jul 14 '15 12:07 tsabolov

+1, same error message. In strict mode via passport-google.

Edit: I fixed it by updating my callback function arguments for the GoogleStrategy object. I realized I was using an old configuration which caused the error.

akyoto avatar Feb 15 '16 06:02 akyoto

I have to take back what I said in the update of my last post. Actually the same error is now occurring in the Facebook plugin using oauth. This is causing me some major headaches because I can't get Facebook login to work. Strict mode is required for my software stack.

akyoto avatar Feb 17 '16 04:02 akyoto

Any update on this? I have the same issue.

etano avatar Mar 17 '16 10:03 etano