SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

hasCredentials #

Checks if a user has credentials registered for the specified authentication strategy.


hasCredentials(strategy, kuid, [options]);

PropertyTypeDescription
strategy
string
Strategy identifier
kuid
string
User kuid
options
object
Query options

options #

PropertyType
(default)
Description
queuable
boolean

(true)
If true, queues the request during downtime, until connected to Kuzzle again

Resolves #

A boolean telling whether the user can log in using the provided authentication strategy.

Usage #

try {
  const response = await kuzzle.security.hasCredentials('local', 'john.doe');
  console.log(response);
  /*
  true
    */
} catch (e) {
  console.error(e);
}