openmrs-esm-core

O3 Framework / clearCurrentUser

Function: clearCurrentUser()

clearCurrentUser(): void

Defined in: packages/framework/esm-api/src/current-user.ts:230

Clears the current user session from the session store, setting the session to an unauthenticated state. This is typically called during logout to reset the application’s authentication state.

Returns

void

Example

import { clearCurrentUser } from '@openmrs/esm-api';
// During logout
clearCurrentUser();