@@ -38,6 +38,11 @@ passport.use(
3838 if ( ! user ) {
3939 done ( null , false , { msg : `Email ${ email } not found.` } ) ;
4040 return ;
41+ } else if ( user . banned ) {
42+ const msg =
43+ 'Account has been suspended. Please contact privacy@p5js.org if you believe this is an error.' ;
44+ done ( null , false , { msg } ) ;
45+ return ;
4146 }
4247 user . comparePassword ( password , ( innerErr , isMatch ) => {
4348 if ( isMatch ) {
@@ -65,6 +70,12 @@ passport.use(
6570 done ( null , false ) ;
6671 return ;
6772 }
73+ if ( user . banned ) {
74+ const msg =
75+ 'Account has been suspended. Please contact privacy@p5js.org if you believe this is an error.' ;
76+ done ( null , false , { msg } ) ;
77+ return ;
78+ }
6879 user . findMatchingKey ( key , ( innerErr , isMatch , keyDocument ) => {
6980 if ( isMatch ) {
7081 keyDocument . lastUsedAt = Date . now ( ) ;
@@ -116,13 +127,19 @@ passport.use(
116127 new Error ( 'GitHub account is already linked to another account.' )
117128 ) ;
118129 return ;
130+ } else if ( existingUser . banned ) {
131+ const msg =
132+ 'Account has been suspended. Please contact privacy@p5js.org if you believe this is an error.' ;
133+ done ( new Error ( msg ) ) ;
134+ return ;
119135 }
120136 done ( null , existingUser ) ;
121137 return ;
122138 }
123139
124140 const emails = getVerifiedEmails ( profile . emails ) ;
125141 const primaryEmail = getPrimaryEmail ( profile . emails ) ;
142+ console . log ( profile ) ;
126143
127144 if ( req . user ) {
128145 if ( ! req . user . github ) {
@@ -196,11 +213,15 @@ passport.use(
196213 )
197214 ) ;
198215 return ;
216+ } else if ( existingUser . banned ) {
217+ const msg =
218+ 'Account has been suspended. Please contact privacy@p5js.org if you believe this is an error.' ;
219+ done ( new Error ( msg ) ) ;
220+ return ;
199221 }
200222 done ( null , existingUser ) ;
201223 return ;
202224 }
203-
204225 const primaryEmail = profile . _json . emails [ 0 ] . value ;
205226
206227 if ( req . user ) {
0 commit comments