mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-25 10:18:38 +02:00
feat: database migrations
This commit is contained in:
6
common/schemas/auth.surql
Normal file
6
common/schemas/auth.surql
Normal file
@@ -0,0 +1,6 @@
|
||||
# Defines authentication scope and access rules.
|
||||
# This mirrors the logic previously in SurrealDbClient::setup_auth
|
||||
|
||||
DEFINE ACCESS IF NOT EXISTS account ON DATABASE TYPE RECORD
|
||||
SIGNUP ( CREATE user SET email = $email, password = crypto::argon2::generate($password), anonymous = false, user_id = $user_id) # Ensure user_id is provided if needed
|
||||
SIGNIN ( SELECT * FROM user WHERE email = $email AND crypto::argon2::compare(password, $password) );
|
||||
Reference in New Issue
Block a user