CredentialsExist #
Checks that the current user has credentials for the specified strategy.
Arguments #
func (a *Auth) CredentialsExist(strategy string, options types.QueryOptions) (bool, error)
Arguments | Type | Description | Required |
---|---|---|---|
strategy | string | Strategy to use | yes |
options | QueryOptions | A structure containing query options | yes |
Options #
Additional query options
Property | Type | Description | Default |
---|---|---|---|
Queuable | boolean | Make this request queuable or not | true |
Return #
True if exists, false if not.
Usage #
kuzzle.Auth.Login("local", json.RawMessage("{\"username\":\"foo\",\"password\":\"bar\"}"), nil)
res, err := kuzzle.Auth.CredentialsExist("local", nil)
if err != nil {
log.Fatal(err)
} else {
if res == true {
fmt.Println("Success")
} else {
log.Fatal("Error")
}
}
Edit this page on Github(opens new window)