-
Notifications
You must be signed in to change notification settings - Fork 58
Fix user update before consents to terms #1481
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,10 @@ export function isNewUser(loggedInUser) { | |
return !loggedInUser.hasConsentedToTerms | ||
} | ||
|
||
export function userExistsInDatabase(loggedInUser) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you mean |
||
return !loggedInUser.id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
// Helper functions to determine if | ||
// a location is home or work. | ||
export const isHome = (loc) => loc.type === 'home' | ||
|
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.
I thought the user entry in Mongo was meant to be created when they click "Next" after accepting the terms of use. I think you uncovered a bug that results in the user being created when they set the language and before they agree to the terms. Congrats!
To fix the bug:
In lib/actions/ui.js near line 471: replace
with
(with correct import and corrected name/meaning.