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

check function issue when not passing arguments #40

Open
bluntcarrot opened this issue Feb 11, 2016 · 0 comments
Open

check function issue when not passing arguments #40

bluntcarrot opened this issue Feb 11, 2016 · 0 comments

Comments

@bluntcarrot
Copy link

So I am using the example provided and noticed I can do a get request on the '/user' endpoint without being logged in. To my understanding this should not happen because the check() middleware function is being called. This is the endpoint in the app:

app.get('/user', oidc.check(), function(req, res, next){ res.send('<h1>User Page</h1><div><a href="/client">See registered clients of user</a></div>'); });

Upon further investigation, it appears that check() function is calling next() if no arguments are passed. The issue starts on line 1022:

if(!scopes.length) { next(); }

If the if/else statement is removed everything seems to work fine. If this is not an issue, or I am just not understanding properly please let me know.

EDIT: I am continuing to work on this code and have now realized that what I mentioned above as a fix probably is not a good solution. However, inside the check() function the 'loggedIn' policy is set to false:

self.use({policies: {loggedIn: false}, models:['access', 'auth']})

The documentation mentions the function is used to check if the user is logged in. Is setting this to true the correct answer?

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

1 participant