mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-06 19:08:06 +08:00
reduced the amount of logs
This commit is contained in:
parent
f34010b118
commit
9bf149a491
1 changed files with 2 additions and 1 deletions
|
|
@ -113,11 +113,11 @@ exports.changeName = functions.https.onCall((request,response) => {
|
|||
|
||||
exports.checkIfNeedsToChangeName = functions.https.onCall((request,response) => {
|
||||
try{
|
||||
console.log(`checking if user ${request.uid} needs to change name`);
|
||||
return admin.auth().getUser(request.uid).then(requestUser => {
|
||||
|
||||
if(!isUsernameValid(requestUser.displayName)){
|
||||
//invalid name, needs to change
|
||||
console.log(`user ${requestUser.uid} ${requestUser.displayName} needs to change name`);
|
||||
return 1;
|
||||
}else{
|
||||
//valid name, but need to change if not duplicate
|
||||
|
|
@ -152,6 +152,7 @@ exports.checkIfNeedsToChangeName = functions.https.onCall((request,response) =>
|
|||
})
|
||||
|
||||
if((new Date(requestUser.metadata.creationTime).getTime() / 1000) > earliestTimestamp){
|
||||
console.log(`user ${requestUser.uid} ${requestUser.displayName} needs to change name`);
|
||||
return 2;
|
||||
}else{
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue