Skip to content

Instantly share code, notes, and snippets.

View SandeshSarfare's full-sized avatar

Sandesh SandeshSarfare

View GitHub Profile
@SandeshSarfare
SandeshSarfare / gist:27cc755729c2ef0510d0
Created January 21, 2016 07:05
getCurrentContext() returns null randomly
//Members.js
----javascript
Members.getMember = function(Id, cb) {
var ctx = loopback.getCurrentContext();
var currentUser = ctx && ctx.get('currentUser');
var realms = [];
realms = currentUser.realm.split(",");
var fltr = {