Skip to contents

Returns the currently registered authentication hook function.

Usage

csdb_get_auth_hook()

Value

The current authentication hook function, or NULL when no hook is set.

See also

DBConnection_v9, whose connect() method calls this function to look up the hook. The introduction vignette, vignette("csdb", package = "csdb"), does not mention this function.

Other auth hook functions: csdb_set_auth_hook()

Examples

# Returns NULL when no hook has been set
csdb_get_auth_hook()
#> NULL

# \donttest{
# Register a hook and then read it back. Registering does not call it.
previous <- csdb_set_auth_hook(function() {
  system2("/bin/kinit", stdout = NULL)
})
hook <- csdb_get_auth_hook()
is.function(hook)
#> [1] TRUE

csdb_set_auth_hook(previous)
# }