-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
Give tasks padding to not overlap on mobile, keep email input and button bigger, and update image sizes
[diff-counting] Significant lines: 80. |
src/components/Login.vue
Outdated
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; | ||
}, |
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 looks bad. You are implicitly exposing the alpha whitelist email to the entire world, since you need to loop over the entire snapshot.
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.
My suggestion:
- Write firebase security rules so that user can only access his/her own whitelist document
- Try to access that document
- 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.
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.
Remember to enable Google analytics
Change whitelist to only allow a user to read their own document
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.
Looks more secure now!
…dti/course-plan into landingPageEnhancements
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.
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.