func (a *CookieAuth) Authenticate(ctx context.Context, c *Client) error {
	if err := a.setCookieJar(c); err != nil {
		return err
	}
	buf := &bytes.Buffer{}
	if err := json.NewEncoder(buf).Encode(a); err != nil {
		return err
	}
	if _, err := c.DoError(ctx, kivik.MethodPost, "/_session", &Options{Body: buf}); err != nil {
		return err
	}
	return ValidateAuth(ctx, a.Username, c)
}
// Authenticate initiates a session with the CouchDB server.
Authenticate initiates a session with the CouchDB server.
// Authenticate initiates a session with the CouchDB server .
func (a *CookieAuth) Authenticate(ctx context.Context, c *Client) error {
	if err := a.setCookieJar(c); err != nil {
		return err
	}
	buf := &bytes.Buffer{}
	if err := json.NewEncoder(buf).Encode(a); err != nil {
		return err
	}
	if _, err := c.DoError(ctx, kivik.MethodPost, "/_session", &Options{Body: buf}); err != nil {
		return err
	}
	return ValidateAuth(ctx, a.Username, c)
}
func ( a * CookieAuth ) Authenticate ( ctx context . Context , c * Client ) error { if err := a . setCookieJar ( c ) ; err != nil { return err } buf := & bytes . Buffer { } if err := json . NewEncoder ( buf ) . Encode ( a ) ; err != nil { return err } if _ , err := c . DoError ( ctx , kivik . MethodPost , " " , & Options { Body : buf } ) ; err != nil { return err } return ValidateAuth ( ctx , a . Username , c ) }
Authenticate initiates a session with the CouchDB server.
Authenticate initiates a session with the CouchDB server .