i'm trying to use db.info in the js sdk, but i'm getting undefined as a response
Steps to reproduce
my surrealql:
DEFINE TABLE Posts SCHEMAFULL
PERMISSIONS
FOR create, update, delete WHERE user = $auth.id;
DEFINE FIELD title ON TABLE Posts TYPE string;
DEFINE FIELD content ON TABLE Posts TYPE string;
DEFINE FIELD description ON TABLE Posts TYPE string;
DEFINE FIELD user ON TABLE Posts TYPE record(Users) DEFAULT $auth.id;
DEFINE TABLE Users SCHEMAFULL
PERMISSIONS
FOR select, update, delete WHERE id = $auth.id;
DEFINE FIELD username ON TABLE Users TYPE string;
DEFINE FIELD email ON TABLE Users TYPE string
ASSERT string::is::email($value);
DEFINE FIELD password ON TABLE Users TYPE string;
DEFINE INDEX emailUnique ON TABLE Users COLUMNS email UNIQUE;
DEFINE SCOPE Auth
SESSION 3d
SIGNUP (
INSERT INTO User
(username, email, password)
VALUES
($username, $email, crypto::argon2::generate($password))
)
SIGNIN (
SELECT * FROM User WHERE
email = $email
AND crypto::argon2::compare(password, $password)
)
;
Describe the bug
i'm trying to use db.info in the js sdk, but i'm getting undefined as a response
Steps to reproduce
my surrealql:
my typescript code:
connect.ts
user.ts
db.authenticate
returns true but stilldb.info
returns undefined If I usedb.signin
ordb.signup
in theAuth
scope the same thing happensExpected behaviour
get the authenticated user data instead of an
undefined
SurrealDB version
surreal 1.1.1 for linux on amd64
SurrealDB.js version
0.11.0
Contact Details
fjachuf@gmail.com
Is there an existing issue for this?
Code of Conduct