% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/r6_DBConnection_v9.R
\name{csdb_set_auth_hook}
\alias{csdb_set_auth_hook}
\title{Set authentication hook for database connections}
\usage{
csdb_set_auth_hook(hook)
}
\arguments{
\item{hook}{A function with no arguments that performs authentication,
or NULL to clear the hook.}
}
\value{
Invisibly returns the previous hook (if any).
}
\description{
Register a function to be called when a database connection fails.
This is useful for refreshing Kerberos tickets or other authentication
credentials before retrying the connection.
}
\examples{
\dontrun{
# Set an auth hook to refresh Kerberos credentials
csdb_set_auth_hook(function() {
  system2("/bin/authenticate.sh", stdout = NULL)
})

# Clear the hook
csdb_set_auth_hook(NULL)
}
}
