Readonly
loginReturns 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 identity of type
'onlineWithAuthentication'.
Returns the current authentication status.
Log in to Ditto with a third-party token. Throws if authentication is not available, which can be checked with loginSupported.
the authentication token required to log in.
the name of the authentication provider.
Log in to Ditto with a username and password. Throws if authentication is not available, which can be checked with loginSupported.
the username component of the credentials used for log in.
the password component of the credentials used for log in.
the name of the authentication provider.
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.
Optional
cleanupFn: ((ditto) => void)An 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.
Log in to a remote authentication service, using an
OnlineWithAuthentication
or anOnline
identity.