File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,14 @@ module.exports = {
80
80
const svc_email = req . services . get ( 'email' ) ;
81
81
svc_email . send_email ( { email : req . user . email } , 'password_change_notification' ) ;
82
82
83
+ // Kick out all other sessions
84
+ const svc_auth = req . services . get ( 'auth' ) ;
85
+ const sessions = await svc_auth . list_sessions ( req . actor ) ;
86
+ for ( const session of sessions ) {
87
+ if ( session . current ) continue ;
88
+ await svc_auth . revoke_session ( req . actor , session . uuid ) ;
89
+ }
90
+
83
91
return res . send ( 'Password successfully updated.' )
84
92
}
85
93
} ;
Original file line number Diff line number Diff line change @@ -365,11 +365,14 @@ class AuthService extends BaseService {
365
365
mysql : ( ) => session . meta ,
366
366
otherwise : ( ) => JSON . parse ( session . meta ?? "{}" )
367
367
} ) ( ) ;
368
+ sessions . push ( session ) ;
369
+ } ;
370
+
371
+ for ( const session of sessions ) {
368
372
if ( session . uuid === actor . type . session ) {
369
373
session . current = true ;
370
374
}
371
- sessions . push ( session ) ;
372
- } ;
375
+ }
373
376
374
377
return sessions ;
375
378
}
You can’t perform that action at this time.
0 commit comments