Skip to content

Instantly share code, notes, and snippets.

@lulalachen
Last active March 29, 2019 22:15
Show Gist options
  • Save lulalachen/be74c3e67dc622b8c07735d644f8922a to your computer and use it in GitHub Desktop.
Save lulalachen/be74c3e67dc622b8c07735d644f8922a to your computer and use it in GitHub Desktop.
Copy the curl from the network and run this command in terminal
# Or you can replace the `pbpaste` with the curl you copied
# and remember to add a `\` and the end of line
curl 'https://url.com/auth/v1/login?type=admin' -X POST -H 'Accept: application/json' -H 'Referer: https://url.com/login?next=/profile/personal' -H 'Origin: https://urlcom' -H 'User-Agent: Chrome/73.0.3683.86 Safari/537.36' -H 'Authorization: Basic xxxxxxxxxxx' -H 'Content-Type: application/json' --compressed \
| bash \
| tr -d '[:space:]' \
| sed -e 's/roles/role/g' \
| sed -e 's/\["/"/g' \
| sed -e 's/\"]/"/g' \
| ( \
echo "Object.entries(" \
&& cat \
&& echo ").map(([k,v]) => localStorage.setItem(k, v))" \
&& echo "localStorage" \
) \
| pbcopy
# Steps
# 1. Copy the `curl` of the network request
# 2. Run this command in terminal
# 3. Go into the browser and paste in browser console
pbpaste \
| bash \
| tr -d '[:space:]' \
| sed -e 's/roles/role/g' \
| sed -e 's/\["/"/g' \
| sed -e 's/\"]/"/g' \
| ( \
echo "Object.entries(" \
&& cat \
&& echo ").map(([k,v]) => localStorage.setItem(k, v))" \
&& echo "localStorage" \
) \
| pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment