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

oauth-encryption package throws underscore error when included in custom smart package #2165

Closed
tbjers opened this Issue May 20, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@tbjers
Contributor

tbjers commented May 20, 2014

I have included oauth-encryption in a custom smart package to encrypt passwords, but when I add oauthSecretKey to Accounts.config({}) my server crashes with the following error:

W20140520-14:26:29.066(-4)? (STDERR)
W20140520-14:26:29.067(-4)? (STDERR) /Users/tbjers/.meteor/tools/6f23056589/lib/node_modules/fibers/future.js:173
W20140520-14:26:29.067(-4)? (STDERR)                                            throw(ex);
W20140520-14:26:29.067(-4)? (STDERR)                                                  ^
W20140520-14:26:29.077(-4)? (STDERR) ReferenceError: _ is not defined
W20140520-14:26:29.078(-4)? (STDERR)     at Object.OAuthEncryption._isBase64 (packages/oauth-encryption/encrypt.js:20)
W20140520-14:26:29.078(-4)? (STDERR)     at Object.OAuthEncryption.loadKey (packages/oauth-encryption/encrypt.js:36)
W20140520-14:26:29.078(-4)? (STDERR)     at Object.Accounts.config (packages/accounts-base/accounts_common.js:64)
W20140520-14:26:29.078(-4)? (STDERR)     at packages/myproject/lib/accounts.js:1
W20140520-14:26:29.078(-4)? (STDERR)     at packages/myproject.js:35:4
W20140520-14:26:29.078(-4)? (STDERR)     at packages/myproject.js:228:3
W20140520-14:26:29.079(-4)? (STDERR)     at /Users/tbjers/git/Projects/myproject-meteor/.meteor/local/build/programs/server/boot.js:155:10
W20140520-14:26:29.079(-4)? (STDERR)     at Array.forEach (native)
W20140520-14:26:29.079(-4)? (STDERR)     at Function._.each._.forEach (/Users/tbjers/.meteor/tools/6f23056589/lib/node_modules/underscore/underscore.js:79:11)
W20140520-14:26:29.079(-4)? (STDERR)     at /Users/tbjers/git/Projects/myproject-meteor/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8

My package.js file:

Package.describe({
  summary: 'Main MyProject application package.'
});

Package.on_use(function (api) {
  api.use([
    'underscore',
    'iron-router',
    'blaze-layout',
    'templating',
    'ui',
    'handlebars',
    'reactive-dict',
    'accounts-base',
    'accounts-password',
    'oauth-encryption',
    'stripe'
  ]);

  api.export([
    'BaseController',
    'HomeController'
  ]);

  api.export([
    'Payment'
  ], ['server']);

  api.add_files([
    'lib/layouts/containers.html',
    'lib/layouts/home.html'
  ], ['client']);

  api.add_files([
    'lib/accounts.js',
    'lib/payment.js'
  ], ['server']);

  api.add_files([
    'lib/app.js',
    'lib/controller.js',
    'lib/home.js'
  ], ['client', 'server']);
});

My lib/accounts.js file:

Accounts.config({
  sendVerificationEmail: true,
  oauthSecretKey: 'onsqJ+1e4iGFlV0nhZYobg=='
});

The only thing I can think of here is that there's no use statement for underscore in the oauth-encryption package file, but maybe this is something else.

I've asked on the mailing list as well as the #meteor channel without any luck.

Please advise.

@estark37

This comment has been minimized.

Contributor

estark37 commented May 20, 2014

Thanks! This should be fixed on devel (0a4b7b5)

@estark37 estark37 closed this May 20, 2014

@tbjers

This comment has been minimized.

Contributor

tbjers commented May 20, 2014

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment