SDK
SDK Golang v3.x
2

CredentialsExist #

Checks that the current user has credentials for the specified strategy.

Arguments #

func (a *Auth) CredentialsExist(strategy string, options types.QueryOptions) (bool, error)
ArgumentsTypeDescriptionRequired
strategy
string
Strategy to useyes
options
QueryOptions
A structure containing query optionsyes

Options #

Additional query options

PropertyTypeDescriptionDefault
Queuable
boolean
Make this request queuable or nottrue

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")
  }
}