SDK
SDK Golang v1.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.

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