.SignUp()
Signs up to a specific authentication scope / access method.
Method Syntaxawait db.SignUp(credentials)
Arguments | Description | ||
---|---|---|---|
credentials required | Credentials to sign up as a scoped user. |
// Sign in to authentication `db` using the root user authData := &surrealdb.Auth{ Username: "root", // use your setup username Password: "root", // use your setup password Namespace = "test", Database = "test", Access = "user", Email = "info@surrealdb.com", Password = "123456" } token, err := db.SignUp(authData) if err != nil { panic(err) }
// Sign in to authentication `db` using the root user authData := &surrealdb.Auth{ Username: "root", // use your setup username Password: "root", // use your setup password Namespace = "test", Database = "test", Scope = "user", Email = "info@surrealdb.com", Password = "123456" } token, err := db.SignUp(authData) if err != nil { panic(err) }
You can invalidate the authentication for the current connection using the Invalidate()
method.