deleteSession method
Deletes a single user's session from the server and memory.
Implementation
Future<void> deleteSession(String userId) {
return monitoringService.monitorAction<void>(
actionName: 'delete_session',
provider: _providerName,
attributes: {'userId': userId},
action: (trace) async {
_ensureInitialized();
try {
var request = DeleteSessionRequest(userId);
await sessionService.deleteSession(request);
logger.info(
this,
'Successfully deleted session for $userId on server.',
);
} finally {
await _localSessionRepository.deleteSession(userId);
logger.info(this, 'Removed session for $userId from memory.');
}
},
);
}