fetchCurrentUser
Overview
Fetches the current user from the who-is endpoint and updates the login state and currentUserRequestStatus. When the authenticated user changes, clears the authorization-dependent stores and increments identityGeneration.
Only the newest request writes the user fields and currentUserRequestStatus. The promise of an older request settles with the newest request's outcome, so a caller that awaits it reads the newest answer.
Signature
fetchCurrentUser(options)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| options | object | no | Fetch options. |
options Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| preserveError | boolean | Whether to leave the store-wide error and errored unchanged, on success and on failure. currentUserRequestStatus records the outcome either way. |
Returns
Promise
Resolves once the state is updated; rejects with the request error.
Source
client/lib/stores/storeUser.js:214