-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#527 회원 탈퇴 구현 #528
Open
kmc7468
wants to merge
25
commits into
dev
Choose a base branch
from
#527-account-delete
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
#527 회원 탈퇴 구현 #528
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c4ce04b
Add: /users/delete endpoint
kmc7468 dd6d7c1
Add: personal information delete cronjob
kmc7468 f11f158
Refactor: rename withdraw-related endpoint/schema
kmc7468 3e87619
Add: restore withdraw field of userSchema
kmc7468 e7926e5
Refactor: check if user withdrew when populating chat and user documents
kmc7468 996b9ee
Refactor: use userOid instead of userId
kmc7468 c340df9
Refactor: check if user withdrew when populating documents
kmc7468 670eae6
Refactor: now remove FCM device tokens when withdrawing
kmc7468 00ddb69
Docs: withdraw endpoint swagger
kmc7468 7c596a9
Add: authorIsWithdraw field
kmc7468 d9ed57b
Fix: chat.authorId can be nullish value
kmc7468 826ee1a
Fix: withdrew user populate error
kmc7468 69127d5
Add: withdraw field in room/report related responses
kmc7468 423571b
Merge branch 'dev' into #527-account-delete
kmc7468 3af8bf7
Refactor: compile speed & ts-node startup speed optmization
kmc7468 372ecab
Fix: test error
kmc7468 f58f645
Add: withdraw check into items.js
kmc7468 069241b
Refactor: use sid in responseTimeMiddleware
kmc7468 e54cca3
Add: migration script that converts userId to userOid in chats
kmc7468 1338fcc
Refactor: getIsOver function now uses userOid instead of userId
kmc7468 0f7c9dd
Fix: sample generator inserts userId into chat.content
kmc7468 d290945
Fix: isOver is always false
kmc7468 aff0f86
Add: rejoin restriction after user withdrawal
kmc7468 4d63ff8
Refactor: ensure user is logged out immediately upon withdrawal
kmc7468 7665b97
Fix: docs and validator for withdraw endpoint
kmc7468 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const { userModel } = require("../modules/stores/mongo"); | ||
const logger = require("../modules/logger"); | ||
|
||
module.exports = async () => { | ||
try { | ||
// 탈퇴일로부터 1년 이상 경과한 사용자의 개인정보 삭제 | ||
await userModel.updateMany( | ||
{ | ||
withdraw: true, | ||
withdrawAt: { $lte: new Date(Date.now() - 365 * 24 * 60 * 60 * 1000) }, | ||
name: { $ne: "" }, | ||
}, | ||
{ | ||
$set: { | ||
name: "", | ||
nickname: "", | ||
id: "", | ||
profileImageUrl: "", | ||
// ongoingRoom | ||
// doneRoom | ||
ban: false, | ||
// joinat | ||
agreeOnTermsOfService: false, | ||
"subinfo.kaist": "", | ||
"subinfo.sparcs": "", | ||
"subinfo.facebook": "", | ||
"subinfo.twitter": "", | ||
email: "", | ||
isAdmin: false, | ||
account: "", | ||
}, | ||
$unset: { | ||
phoneNumber: "", | ||
}, | ||
} | ||
); | ||
} catch (err) { | ||
logger.error(err); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 나중에 코드볼때 헷갈릴 것 같아서
// user.userId는 userOid입니다.
이런 주석 하나만 달아주시면 좋을듯 합니다