.SignUp()

Signs up to a specific authentication scope / access method.

Method Syntax

await db.SignUp(credentials)

Arguments

ArgumentsDescription
credentials Credentials to sign up as a scoped user.
cancellationToken The cancellationToken enables graceful cancellation of asynchronous operations.

Example usage

// With Record Access
var authParams = new AuthParams
{
Namespace = "test",
Database = "test",
Access = "user",
// Also pass any properties required by the access definition
Email = "info@surrealdb.com",
Password = "123456"
};

Jwt jwt = await db.SignUp(authParams);

public class AuthParams : ScopeAuth
{
public string? Username { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
}

You can invalidate the authentication for the current connection using the Invalidate() method.