surrealdb / surrealist

Surrealist is the ultimate way to visually manage your SurrealDB database
https://surrealist.app/
MIT License
1.06k stars 81 forks source link

Can't do scope authentication #44

Closed SorenHolstHansen closed 1 year ago

SorenHolstHansen commented 1 year ago

This is probably not an issue with surrealist, but I have tried for a long time, and hope you can solve my issue.

I have defined a database scope called user_scope with a signup query: CREATE user SET email = $email, pass = crypto::argon2::generate($pass) and signin query SELECT * FROM user WHERE email = $email AND crypto::argon2::compare(pass, $pass) with 12h session duration.

However when trying to do scope authentication in the connection details like this

Screenshot 2023-04-04 at 22 20 17 Screenshot 2023-04-04 at 22 20 22

It still says I am offline, and the only thing logged in the terminal is 2023-04-04T20:21:19.537330Z INFO surrealdb::net: 127.0.0.1:65491 GET /rpc HTTP/1.1 101 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)" 136.791µs

What am I doing wrong?

macjuul commented 1 year ago

Strange, I recreated your example and it is working successfully on my side (Running SurrealDB beta 9)

I'm not entirely sure what the problem could be. Are you sure a valid user account is present in the database before making the connection? Surrealist only authenticates and doesn't register

SorenHolstHansen commented 1 year ago

Arrrh, I didn't have a user account present, thought they did registration as well. It worked now with a user in the database, thanks a lot