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

Validate function: TypeError #65

Closed
kevman opened this issue Feb 3, 2015 · 4 comments
Closed

Validate function: TypeError #65

kevman opened this issue Feb 3, 2015 · 4 comments
Assignees
Labels

Comments

@kevman
Copy link

kevman commented Feb 3, 2015

I'm using Slingshot 0.4.1 and I'm getting the following error:

// lib/uploads.js
validate: function(file) {
  var context = {
    userId: Meteor.userId() // Uncaught TypeError: undefined is not a function
  };
  try {
    var validators = Slingshot.Validators,
        restrictions = Slingshot.getRestrictions(directive);

    validators.checkAll(context, file, metaData, restrictions) && null;
  } catch(error) {
    return error;
  }
}
@kevman
Copy link
Author

kevman commented Feb 3, 2015

Update: I need to add at least one login provider package: accounts-password, ...

@gsuess gsuess added the invalid label Feb 3, 2015
@kevman
Copy link
Author

kevman commented Feb 3, 2015

Without the accounts package you will get the error.

var context = {
userId: Meteor.userId() // Uncaught TypeError: undefined is not a function
};

@kevman
Copy link
Author

kevman commented Feb 3, 2015

Your package depends on accounts too.

@gsuess
Copy link
Contributor

gsuess commented Feb 3, 2015

Ah sorry, didn't see the comment.

@gsuess gsuess added bug and removed invalid labels Feb 3, 2015
@gsuess gsuess self-assigned this Mar 22, 2015
gsuess added a commit that referenced this issue Mar 22, 2015
#65 Meteor.userId() is only available when accounts-base package is enabled
@gsuess gsuess closed this as completed Mar 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants