fix(ente): emails are encrypted in DB, query first user_id instead
Museum encrypts emails before storing (encrypted_email column). Cannot query by plaintext email. Instead select the first user_id which is the admin user created during first-start setup.
This commit is contained in:
@@ -357,9 +357,9 @@ fi
|
||||
|
||||
DB_NAME="$(grep -A4 '^db:' /opt/ente/server/museum.yaml | awk '/name:/{print $2}')"
|
||||
DB_PASS="$(grep -A5 '^db:' /opt/ente/server/museum.yaml | awk '/password:/{print $2}')"
|
||||
USER_ID=$(PGPASSWORD="$DB_PASS" psql -h 127.0.0.1 -U ente -d "$DB_NAME" -tAc "SELECT user_id FROM users WHERE email='$EMAIL' LIMIT 1;")
|
||||
USER_ID=$(PGPASSWORD="$DB_PASS" psql -h 127.0.0.1 -U ente -d "$DB_NAME" -tAc "SELECT user_id FROM users ORDER BY user_id LIMIT 1;")
|
||||
if [ -z "$USER_ID" ]; then
|
||||
echo "Error: No user found with email $EMAIL"
|
||||
echo "Error: No users found in database."
|
||||
echo "Make sure you created and verified the account via the web UI first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user