Signs up to a specific authentication access method.
Method Syntax
$db->signup([
"namespace" => "main",
"database" => "db",
"access" => "account",
// ... other variables
]);Arguments
Arguments | Description |
|---|---|
namespace | The namespace to sign up to |
database | The database to sign up to |
access | The access method to sign up to. Also pass any variables used in the access definition. |
Example usage
$token = $db->signup([
"namespace" => "surrealdb",
"database" => "docs",
"access" => "user",
// Also pass any properties required by the access definition
"email" => "info@surrealdb.com",
"pass" => "123456",
]);You can invalidate the authentication for the current connection using the invalidate() method.