manjeshpv / node-oauth2-server-implementation

Using oauth2-server: 3.0.0-b2 & Supports MongoDB, MySQL, PostgreSQL, MSSQL & SQLite
216 stars 103 forks source link

503 - User is not defined #19

Open kosicki123 opened 7 years ago

kosicki123 commented 7 years ago

Hi, I'm having this error using MySQL. I've just changed the path to the database. Nothing else was changed. Any ideas? { "statusCode": 503, "status": 503, "code": 503, "message": "user is not defined", "name": "server_error", "inner": {} }

kosicki123 commented 7 years ago

The problem was validateScope method. Commenting it fixed the issue, but probably mess up another thing.

kosicki123 commented 7 years ago

Any idea on how to properly validate the scope? Scope parameter is always undefined. function validateScope(user, client, scope) { }

mas-iota commented 7 years ago

@kosicki123 Have you solved it yet ?!

walank commented 7 years ago

It works for me after I replaced: function validateScope(token, client) { with function validateScope(user,client,scope) {

kosicki123 commented 7 years ago

Nope, still unsolved :(

gustavoandrade10 commented 6 years ago

This should work

function validateScope(user, client, scope) { return (user.scope === 'profile') ? 'profile' : false }