Add remove-from-cart, a cookie-login helper, and stop rotated cookie files escaping .gitignore#11
Open
vyakunin wants to merge 1 commit into
Open
Add remove-from-cart, a cookie-login helper, and stop rotated cookie files escaping .gitignore#11vyakunin wants to merge 1 commit into
vyakunin wants to merge 1 commit into
Conversation
…ignore - remove-from-cart: drop a single item by ASIN instead of only clear-cart, so a swap doesn't wipe unrelated cart items. Test included. - login_and_save_cookies.cjs: visible Puppeteer login that writes amazonCookies .json; reads AMAZON_EMAIL / AMAZON_PASSWORD from the environment. - .gitignore: the rule was the bare filename `amazonCookies.json`, so rotated copies (`amazonCookies.json.bak.<ts>`) were untracked but NOT ignored. Those hold live session-token / at-main auth cookies, so a `git add -A` would commit a working Amazon session. Ignore the .bak variants too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three independent changes; happy to split if you prefer separate PRs.
1.
remove-from-cartToday the only removal tool is
clear-cart, so swapping one item means wiping the cart and re-adding everything. This addsremove-from-cart, which drops a single item by ASIN and leaves the rest untouched. Test included.2.
login_and_save_cookies.cjsA visible Puppeteer login that writes
amazonCookies.json, so first-time setup does not mean hand-copying cookies out of devtools. Credentials come fromAMAZON_EMAIL/AMAZON_PASSWORDin the environment — nothing is written to disk except the cookie file the server already expects.3.
.gitignore— the one worth reviewingThe existing rule is the bare filename:
Any rotated or backup copy —
amazonCookies.json.bak,amazonCookies.json.bak.20260621_164507— is therefore untracked but not ignored. Those files hold livesession-token/at-main/sess-at-*values, i.e. a working Amazon session. A singlegit add -Acommits it.That is easy to hit, since taking a backup before a re-login is the natural thing to do. Widened to cover the
.bakvariants.amazonCookies.example.jsonstays tracked.