Search the docs
Languages
/
Mojo
Methods
The signin() method for the SurrealDB Mojo SDK signs in to the database with credentials.
Signs in to the database with CBOR-encoded credentials. On success, the returned token is stored on the client for subsequent requests.
Method Syntax
client.signin(credentials_cbor, session)
credentials_cbor
List[UInt8]
session
from surrealdb import CborCodecfrom std.collections import Listvar codec = CborCodec()var pairs = List[Tuple[String, List[UInt8]]]()pairs.append(Tuple(String("user"), codec.encode_text("root")))pairs.append(Tuple(String("pass"), codec.encode_text("root")))var resp = client.signin(codec.encode_map(pairs))
signin operates on a stateful session, which is provided by the WebSocket transport. WebSocket support is rolling out. Over HTTP, supply credentials with the access_token field on ConnectOptions.
signin
access_token
ConnectOptions
Authentication
signup()
Was this page helpful?
Previous
set
Next
signup