ReadonlyloginReturns true if authentication is available and the login methods can be
used, otherwise returns false. Currently, authentication is only
available if Ditto was initialized with an "server" connection mode
(i.e. DittoConfigConnectServer).
The handler that will be called when authentication for this Ditto instance is about to expire.
Important: If the Ditto instance is configured with a DittoConfigConnectServer this property must be set and the handler must properly authenticate when called.
Returns the current authentication status.
StaticDEVELOPMENT_The built-in development authentication provider to be used together with development authentication tokens.
Authenticator.login() for more information
about the provider parameter.
Log in to Ditto with a third-party token.
Returns a promise that resolves to a LoginResult object. When the login
attempt is successful, the error property of the response will be null,
otherwise it will contain a DittoError object with details about
the error.
If the authentication service provides additional client info, it will be
returned in the clientInfo property of the response, whether the login
attempt was successful or not.
The authentication token required to log in.
The name of the authentication provider. Use Authenticator.DEVELOPMENT_PROVIDER with development tokens.
A promise that resolves to a LoginResult object.
DittoError authentication/failed-to-authenticate if the
Ditto instance is closed.
Log out of Ditto.
This will stop sync, shut down all replication sessions, and remove any
cached authentication credentials. Note that this does not remove any data
from the store. If you wish to delete data from the store then use the
optional cleanupFn parameter to perform any required cleanup.
OptionalcleanupFn: (ditto: Ditto) => voidAn optional function that will be called with the relevant [Ditto] instance as the sole argument that allows you to perform any required cleanup of the store as part of the logout process.
Sets the handler that will be called when authentication for this Ditto instance is about to expire.
Assign a handler function to be notified before authentication expires, allowing you to login or perform other necessary actions.
Provides access to authentication information and methods for logging on to Ditto Cloud. Relevant when using a
serverconnection mode.