@@ -38,6 +38,11 @@ passport.use(
38
38
if ( ! user ) {
39
39
done ( null , false , { msg : `Email ${ email } not found.` } ) ;
40
40
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 ;
41
46
}
42
47
user . comparePassword ( password , ( innerErr , isMatch ) => {
43
48
if ( isMatch ) {
@@ -65,6 +70,12 @@ passport.use(
65
70
done ( null , false ) ;
66
71
return ;
67
72
}
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
+ }
68
79
user . findMatchingKey ( key , ( innerErr , isMatch , keyDocument ) => {
69
80
if ( isMatch ) {
70
81
keyDocument . lastUsedAt = Date . now ( ) ;
@@ -116,13 +127,19 @@ passport.use(
116
127
new Error ( 'GitHub account is already linked to another account.' )
117
128
) ;
118
129
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 ;
119
135
}
120
136
done ( null , existingUser ) ;
121
137
return ;
122
138
}
123
139
124
140
const emails = getVerifiedEmails ( profile . emails ) ;
125
141
const primaryEmail = getPrimaryEmail ( profile . emails ) ;
142
+ console . log ( profile ) ;
126
143
127
144
if ( req . user ) {
128
145
if ( ! req . user . github ) {
@@ -196,11 +213,15 @@ passport.use(
196
213
)
197
214
) ;
198
215
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 ;
199
221
}
200
222
done ( null , existingUser ) ;
201
223
return ;
202
224
}
203
-
204
225
const primaryEmail = profile . _json . emails [ 0 ] . value ;
205
226
206
227
if ( req . user ) {
0 commit comments