Core 2.x

hasCredentials

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


Copied to clipboard!
hasCredentials(strategy, kuid, [options]);

Property Type Description
strategy
string
Strategy identifier
kuid
string
User kuid
options
object
Query options

options

Property Type
(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

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