fix(update-setup): Enhance password hash verification in Authelia account management
Some checks failed
/ validate-docker-compose (push) Has been cancelled

This commit is contained in:
Jose Daniel G. Percy 2025-04-26 01:20:15 +08:00
parent 13b73671f8
commit 6d2baa7300

View File

@ -494,6 +494,17 @@ EOL
fi fi
fi fi
# Strip the "Digest: " prefix if present
password_hash=$(echo "$password_hash" | sed 's/^Digest: //')
# Verify hash format
if [[ ! "$password_hash" =~ ^\$argon2id.*$ ]]; then
echo -e "${RED}Error: Generated hash does not have the expected format. Actual value:${NC}"
echo -e "${YELLOW}$password_hash${NC}"
echo -e "${RED}Skipping user creation.${NC}"
continue
fi
echo -e "${GREEN}Password hash generated successfully.${NC}" echo -e "${GREEN}Password hash generated successfully.${NC}"
# Check if user already exists in the file and update # Check if user already exists in the file and update