SDK
SDK Golang v1.x
1

CredentialsExist #

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

Arguments #

Copied to clipboard!
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 #

Copied to clipboard!
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")
  }
}