File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,12 @@ export class MypageController extends Controller {
353353 ) : Promise < ITsoaSuccessResponse < string > > {
354354 const userId = req . user ! . id ;
355355 const success = await removeUser ( userId ) ;
356+ const sessionID = req . sessionID ;
357+ if ( sessionID . trim ( ) === '' ) {
358+ throw new AuthError ( { reason : 'Session ID가 존재하지 않습니다' } ) ;
359+ }
360+ await logoutUserService ( sessionID ) ;
361+ req . session . destroy ( ( ) => { } ) ;
356362
357363 if ( ! success ) {
358364 throw new AuthError ( { reason : 'user를 찾을 수 없습니다' } ) ;
Original file line number Diff line number Diff line change @@ -18,9 +18,8 @@ export const findUserById = async (
1818
1919export const deleteUser = async ( userId : bigint ) : Promise < boolean > => {
2020 await prisma . user
21- . update ( {
21+ . delete ( {
2222 where : { id : userId } ,
23- data : { status : 0 } ,
2423 } )
2524 . catch ( err => {
2625 throw new DBError ( { reason : err . message } ) ;
You can’t perform that action at this time.
0 commit comments