You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sure. You can take a look at src/index.js to see how config parameters (args) are handled by parse-server. You will want to add an additional parameter for anonymous users. Then, in src/RestWrite.js you will have to check the status of that config parameter whenever creating an anonymous user. You can check the parameter in this.config. You will also need to add some tests in spec/ParseUser.spec.js which might be trickier. I can help you with that when you get there.
I'm not understanding what you mean by "creating an anonymous user". So when a API request comes in, if there is no authentication info it tries to create an anonymous user? Where is that line of code?
I really don't understand the handleAnonymousAuthData of RestWrite. Where does "this.data.authData.anonymous" come from? What is an anonymous provider?
I'm also inferring based on your description that every API request requires a user object before API requests can be made and RestWrite occurs before RestQuery?
Looks like there is some additional discussion and work getting started in #218 and #341. Take at look at the PR to see how those are done (bugfixes for anonymous users), hopefully that can help you get started.
@steven-supersolid since you just were messing around with PR #341 and anonymous users, maybe you can help me determine where to throw an error for this. I'm not sure at exactly which point in RestWrite the user is determined to be anonymous.
Activity
drew-gross commentedon Feb 10, 2016
Currently that is not available in parse-server. Want to submit a PR?
nitrag commentedon Feb 10, 2016
I would be happy to take a stab at it. Someone needs to point me in the right direction though...haven't worked on a Node app before.
drew-gross commentedon Feb 10, 2016
Sure. You can take a look at
src/index.jsto see how config parameters (args) are handled by parse-server. You will want to add an additional parameter for anonymous users. Then, insrc/RestWrite.jsyou will have to check the status of that config parameter whenever creating an anonymous user. You can check the parameter inthis.config. You will also need to add some tests inspec/ParseUser.spec.jswhich might be trickier. I can help you with that when you get there.nitrag commentedon Feb 10, 2016
I'm not understanding what you mean by "creating an anonymous user". So when a API request comes in, if there is no authentication info it tries to create an anonymous user? Where is that line of code?
I really don't understand the handleAnonymousAuthData of RestWrite. Where does "this.data.authData.anonymous" come from? What is an anonymous provider?
I'm also inferring based on your description that every API request requires a user object before API requests can be made and RestWrite occurs before RestQuery?
drew-gross commentedon Feb 10, 2016
Looks like there is some additional discussion and work getting started in #218 and #341. Take at look at the PR to see how those are done (bugfixes for anonymous users), hopefully that can help you get started.
nitrag commentedon Feb 12, 2016
@steven-supersolid since you just were messing around with PR #341 and anonymous users, maybe you can help me determine where to throw an error for this. I'm not sure at exactly which point in RestWrite the user is determined to be anonymous.
flovilmart commentedon Feb 16, 2016
@drew-gross @nitrag I'll get a shot a this, adding enableAnonymousUser: false to the configuration.