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

Landing page enhancements #43

Merged
merged 7 commits into from
Feb 13, 2020
Merged

Landing page enhancements #43

merged 7 commits into from
Feb 13, 2020

Conversation

willespencer
Copy link
Member

@willespencer willespencer commented Feb 4, 2020

Summary

This pull request deals with landing page issues, mainly #39 to alert users if they do not have alpha access, and #37 to fix mobile styling of the task images overlapping with text.

  • include an alert if a user logs in with an account without alpha access
  • remove overlap of task images on mobile
  • fix other responsive design issues like too small of email input on mobile, and awkward image sizes on medium breakpoints
  • fix security problems

reqs

alert

Test Plan

Look over the landing page on a variety of breakpoints to ensure everything looks fine. Also ensure emails without access are given an alert after attempting to login.

Give tasks padding to not overlap on mobile, keep email input and button bigger, and update image sizes
@dti-github-bot
Copy link
Member

dti-github-bot commented Feb 4, 2020

[diff-counting] Significant lines: 80.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2020

Comment on lines 178 to 193
checkEmailAccess(snapshot, user) {
let isAlphaEmail = false;
snapshot.forEach(doc => {
if (doc.data().email === user.user.email) {
isAlphaEmail = true;
}
});
this.performingRequest = false;
if (!isAlphaEmail) {
fb.auth.signOut();
alert('Sorry, but you do not have alpha access.\nPlease sign up below for email updates on when the platform is available and for a chance to test the platform early.');
return false;
}

return true;
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks bad. You are implicitly exposing the alpha whitelist email to the entire world, since you need to loop over the entire snapshot.

Copy link
Contributor

@SamChou19815 SamChou19815 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion:

  1. Write firebase security rules so that user can only access his/her own whitelist document
  2. Try to access that document
  3. If caught insufficient permission error, then we know that the user is not whitelisted.

With this approach, attacker

  • cannot fetch the entire email list
  • cannot know whether someone with a specific email is whitelisted, because the security rules match document against auth information, not query parameter.

Copy link
Member

@handotdev handotdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to enable Google analytics

Change whitelist to only allow a user to read their own document
@github-actions
Copy link
Contributor

Copy link
Contributor

@SamChou19815 SamChou19815 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks more secure now!

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

@handotdev handotdev self-requested a review February 13, 2020 05:02
@willespencer willespencer merged commit 0e47d10 into master Feb 13, 2020
@willespencer willespencer deleted the landingPageEnhancements branch February 13, 2020 06:31
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.

Represent insufficient permissions in the UI Mobile landing overlaps icons with text
4 participants