Skip to content

Commit

Permalink
hide profile by default for new users under 13 (#328)
Browse files Browse the repository at this point in the history
* fix search

* mobile opt + fixes

* check for cur pw

* quality of life small improvements and bugfixes

* bug fixes

* added plurality checker and deleted some comments

* hide profile

* add hideprofile to user schema

* remove hcaptcha

* hideprofile edits (not done)

* edits for year check

* hide profile work

* remove email validation and forgot password from public access

* remove a frontend link

* hide stats as well, make that clear on settings

* formatting for settings personalization

* allow people to see their own stuffs

* hide profile by default when user is under 13

Co-authored-by: Michael <[email protected]>
Co-authored-by: Skippy <[email protected]>
Co-authored-by: Michael Li <[email protected]>
  • Loading branch information
4 people authored Dec 29, 2020
1 parent 712b2d4 commit 28f0030
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = (app, mongo) => {
req.flash('errorFlash', 'You must be at least 13 years old, or have permission from your parent, guardian, teacher, or school to use Mutorials.');
registerInputProblems1 = true;
}

if (!(/^(19|20)\d{2}$/.test(req.body.yob)) || req.body.yob.length != 4 || req.body.yob > new Date().getFullYear()) {
req.flash('errorFlash', 'Please enter a valid year of birth!');
registerInputProblems1 = true;
Expand Down Expand Up @@ -174,6 +174,9 @@ module.exports = (app, mongo) => {
physics: -1,
chemistry: -1,
biology: -1
},
preferences: {
hideProfile: ((new Date().getFullYear() - thisYob)<13 ? true : false)
}
});

Expand Down

0 comments on commit 28f0030

Please sign in to comment.