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

Support for Anonymous Users #750

Merged
merged 9 commits into from
Mar 18, 2019
Merged

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 18, 2019

Also fixed issue with sessionToken not being passed when saving users.

@dplewis dplewis requested a review from acinader March 18, 2019 19:05
@codecov
Copy link

codecov bot commented Mar 18, 2019

Codecov Report

Merging #750 into master will increase coverage by 0.92%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/Parse.js 85.88% <100%> (+0.16%) ⬆️
src/ParseUser.js 79.7% <100%> (+10.25%) ⬆️
src/ParseObject.js 89.87% <100%> (+0.13%) ⬆️
src/AnonymousUtils.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8625ae2...0e98959. Read the comment docs.

Copy link
Contributor

@acinader acinader left a 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.

let registered = false;

const authenticationProvider = {
authData: {
Copy link
Contributor

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:

},

_getAuthProvider() {
const provider = authenticationProvider;
Copy link
Contributor

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.

@dplewis dplewis requested a review from acinader March 18, 2019 20:38
import ParseUser from './ParseUser';
const uuidv4 = require('uuid/v4');

let registered = false;
Copy link
Contributor

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.....

@acinader
Copy link
Contributor

super nice.

@acinader
Copy link
Contributor

@dplewis you wanna cook up a release?

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

Successfully merging this pull request may close these issues.

2 participants