Macbook Pro 8,2 Crashing During Login
This question is an excellent example of the unintended consequences of not addressing a small issue (bad battery) and having it create new issues (crashing).

While it may appear that a bad battery and a crashing hard drive are mutually exclusive, they, in fact, are intrinsically linked.  This however, doesn't preclude the possibility that their are other issues at play, but in order to address efficiently and accurately, you have to eliminate the initial problem.

The Battery

You have a at least an 18 month old battery assuming it was "brand new" when you installed it and not sitting around in a warehouse for a few years prior to your purchase.

Your battery reports its remaining capacity based on a calculation of certain variables - the current voltage and the draw.  It can't measure the batteries ability to hold a charge.  So reading a battery that says 100% only means it's 100% at that moment.

Sleeping on a Dead Battery

When your MacBook Pro detects a low battery condition, it will put the MacBook Pro to sleep.  Going to sleep powers everything down except the RAM;  its current state is kept in RAM so you can quickly resume right where you left off.  If your power gets low enough, it will go into hibernation mode writing the RAM to disk.

If your battery dissipates so quickly as to not allow this state to be saved, you run the risk of corrupting data (and not just your pictures of cats and toasters, but data critical to macOS).  This sounds like the issue you described.



Troubleshooting


Eliminate your battery from the equation.  Disconnect it from the logic board.  Remove the back cover and using a plastic tool (like a spudger) remove the battery connection. Your MacBook doesn't need a battery to function.  You don't need to replace the back cover for the next step, just be certain you are not putting the MBP on a conductive material.  You can put it on a towel if you want.


Check the health of your SSD.  Boot into recovery mode, and run the following commands to check the SMART status of your SSD:

$ diskutil verifyDisk disk0
$ diskutil info disk0 | grep -i smart


Most likely, you will get "Verified" with the last command meaning your SSD is good.  Anything other than "verified" consider getting a new disk.

If everything is good, you can move on to fixing the login issue




Fix Login Issue


Create a new user in Terminal.  Boot into Single User Mode and then issue the following commands

fsck -y
mount -uw /


What you are doing is checking the drive and then mounting the / volume as read/write.  To create a new user, follow the instructions already written up in this post being sure to adjust the values for your specific needs.  Reboot by typing reboot

If you can log in with this newly created account, you corrupted your User Profile and your best bet is to use this new account and/or create another one.

If it solves your issue, you can skip to step 3.  If you can't log in, continue to the next step.
Reinstall macOS.  Operating under the assumption you have made Time Machine backups, reinstall the OS.  Migrate your backed up data using Migration Assistant.  
Run your Mac, but don't disconnect the power. (you're not on battery, remember?) Use your Mac as you normally would.  If you have no problems, then the issue of it crashing is solved.  
Replace the battery.  If everything works, you would have resolved the login crash issue and narrowed down the cause to the failing battery. See this Answer:


  When they [batteries] do die, it's always best to get a good quality replacement
  battery from a reputable manufacturer. The 2006 MBP uses an external
  battery so it's fairly easy to find replacements - and some even come
  with generous warranties.


Even though it's written to address a 2006 MBP, the explanation and recommendations are still valid and relevant.