hasCredentials #
Checks if a user has credentials registered for the specified authentication strategy.
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 #
try {
const response = await kuzzle.security.hasCredentials('local', 'john.doe');
console.log(response);
/*
true
*/
} catch (e) {
console.error(e);
}
Edit this page on Github(opens new window)