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

Cannot read property 'bitMask' of undefined #41

Closed
amanfs opened this issue Oct 9, 2013 · 2 comments
Closed

Cannot read property 'bitMask' of undefined #41

amanfs opened this issue Oct 9, 2013 · 2 comments

Comments

@amanfs
Copy link

amanfs commented Oct 9, 2013

Hey, first of all gotta say I love your method of authentication. I integrated your code, and made a cookie similar to yours

user=%7B%22username%22%3A%22adrian@gmail.com%22%2C%22role%22%3A%7B%22bitMask%22%3A4%2C%22title%22%3A%22admin%22%7D%7D; connect.sess=s%3Aj%3A%7B%22passport%22%3A%7B%7D%7D.Y%2FN8%2F6JZIdX2TJ%2BTKGLvw0Fxbthv7AppwHR0GLB0EpI

But when I try to login in, it breaks at

return accessLevel.bitMask & role.bitMask;

in the service 'Auth' and in the app.js file on the run function

if (!Auth.authorize(next.access)) {
                if(Auth.isLoggedIn()) $location.path('/');
                else                  $location.path('/login');
}

any help would be much appreciated.

screen shot 2013-10-09 at 2 22 38 pm

-Aman

@oGLOWo
Copy link

oGLOWo commented Oct 9, 2013

I was just integrating this into my angular app and I came across what seems to be the same error, but I'm not sure. I get to the same location mentioned above by @amanfs in the debugger and at return accessLevel.bitMask, you'll get a type error because accessLevel is undefined at this point. I'm not sure what I'm doing wrong because I haven't really modified anything other than the call to login to change the the path it sends the login data to.

I'm using angular 1.1.5, but I went back to 1.0.7 to see if that was the issue and it's not. It's still throwing the same type error.

Anyone else seeing this? I really want to get this into my app.

@fnakstad
Copy link
Owner

Hey guys!
From the looks of the error trace the problem may be that you have a route in your routing table which doesn't contain the access property. I get the exact same error message if I intentionally remove the access property from a route and try to access it.

If that's not the problem, maybe you could give me access to the code in question so I can reproduce the problem more accurately?

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

No branches or pull requests

3 participants