-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Support for Anonymous Users #750
Conversation
Codecov Report
@@ Coverage Diff @@
## master #750 +/- ##
==========================================
+ Coverage 89.04% 89.97% +0.92%
==========================================
Files 53 54 +1
Lines 4648 4676 +28
Branches 1072 1076 +4
==========================================
+ Hits 4139 4207 +68
+ Misses 509 469 -40
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. surprised this doesn't exist already.
src/AnonymousUtils.js
Outdated
let registered = false; | ||
|
||
const authenticationProvider = { | ||
authData: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you name the top level 'provider'? little confused as to why we would have authData: authData:
src/AnonymousUtils.js
Outdated
}, | ||
|
||
_getAuthProvider() { | ||
const provider = authenticationProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a no-op. You could just take out this line and change 106 to:
ParseUser._registerAuthenticationProvider(authenticationProvider);
but even better is moving the declaration of authenticationProvider
into this function so that the uuid
is only generated IF it is needed. As you have it here, any time this file is required, it'll generate the uuid
which is relatively expensive. Make it lazy so it is only generated if needed.
import ParseUser from './ParseUser'; | ||
const uuidv4 = require('uuid/v4'); | ||
|
||
let registered = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice if this were exposed on the parse user.....
super nice. |
@dplewis you wanna cook up a release? |
Also fixed issue with sessionToken not being passed when saving users.