File tree Expand file tree Collapse file tree 5 files changed +18
-3
lines changed
Expand file tree Collapse file tree 5 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 76277627 "type": "string"
76287628 }
76297629 },
7630+ "tag": {
7631+ "type": "string"
7632+ },
76307633 "id": {
76317634 "type": "string"
76327635 }
76587661 "security_keys",
76597662 "sessions",
76607663 "system",
7664+ "tag",
76617665 "username",
76627666 "verified",
76637667 "webauthn_enabled"
Original file line number Diff line number Diff line change 80978097 "type" : " string"
80988098 }
80998099 },
8100+ "tag" : {
8101+ "type" : " string"
8102+ },
81008103 "id" : {
81018104 "type" : " string"
81028105 }
81298132 " security_keys" ,
81308133 " sessions" ,
81318134 " system" ,
8135+ " tag" ,
81328136 " username" ,
81338137 " verified" ,
81348138 " webauthn_enabled"
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ router.post(
6868
6969 if ( user && user . email ) {
7070 Email . sendResetPassword ( user , user . email ) . catch ( ( e ) => {
71- console . error ( `Failed to send password reset email to ${ user . username } # ${ user . discriminator } (${ user . id } ): ${ e } ` ) ;
71+ console . error ( `Failed to send password reset email to ${ user . tag } (${ user . id } ): ${ e } ` ) ;
7272 } ) ;
7373 }
7474 } ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ router.post(
5656 return res . sendStatus ( 204 ) ;
5757 } )
5858 . catch ( ( e ) => {
59- console . error ( `Failed to send verification email to ${ user . username } # ${ user . discriminator } : ${ e } ` ) ;
59+ console . error ( `Failed to send verification email to ${ user . tag } : ${ e } ` ) ;
6060 throw new HTTPError ( "Failed to send verification email" , 500 ) ;
6161 } ) ;
6262 } ,
Original file line number Diff line number Diff line change @@ -245,6 +245,13 @@ export class User extends BaseClass {
245245 }
246246 }
247247
248+ public get tag ( ) : string {
249+ //const { uniqueUsernames } = Config.get().general;
250+ const uniqueUsernames = false ;
251+
252+ return uniqueUsernames ? this . username : `${ this . username } #${ this . discriminator } ` ;
253+ }
254+
248255 static async register ( {
249256 email,
250257 username,
@@ -310,7 +317,7 @@ export class User extends BaseClass {
310317 // send verification email if users aren't verified by default and we have an email
311318 if ( ! Config . get ( ) . defaults . user . verified && email ) {
312319 await Email . sendVerifyEmail ( user , email ) . catch ( ( e ) => {
313- console . error ( `Failed to send verification email to ${ user . username } # ${ user . discriminator } : ${ e } ` ) ;
320+ console . error ( `Failed to send verification email to ${ user . tag } : ${ e } ` ) ;
314321 } ) ;
315322 }
316323
You can’t perform that action at this time.
0 commit comments