MacBook shuts down at login screen I have an early 2015 MacBook Pro. I’ve had the service battery warning for over a year now. The battery lasts like 5min nowadays but I’ve been using it like desktop so it’s always plugged in.
I just moved to a new location and haven’t touched my Mac for 2 days. I just logging in as usual and it immediately shuts down. I’ve tried this 10 times now and every time I click on my user icon to type in my password, the MacBook shuts down. This has never happened before.
Does anyone have any advice? I don’t think this is a battery related issue since This is occurring while the MacBook is plugged in.
I have tried resetting the SMC, and it did not work. However after about 20 attempts, I was finally able to log in, but I still want to dig into this problem in case it occurs again.
Did you check by doing PRAM and SMC Reset.It may be hardware issue.Please follow the below steps.
Reset the SMC on computers that have the T2 chip
If your Mac has the Apple T2 Security Chip, follow these steps. If you need help, contact Apple Support.
Notebook computers with the T2 chip
Before resetting the SMC, try these steps:
Shut down your Mac.
Press and hold the power button for 10 seconds, then release the button.
Wait a few seconds, then press the power button to turn on your Mac.
If the issue persists, follow these steps to reset the SMC:
Shut down your Mac.
On your built-in keyboard, press and hold all of the following keys. Your Mac might turn on.
Control  on the left side of your keyboard
Option (Alt)  on the left side of your keyboard
Shift  on the right side of your keyboard
Keep holding all three keys for 7 seconds, then press and hold the power button as well. If your Mac is on, it will turn off as you hold the keys.
do the following to reset PRAM on Mac:
1.Turn off your Mac.
2.Press the power button.
Immediately press the Command+Option+P+R keys.
Hold the keys until your Mac restarts and you hear the startup sound 3 times .
Release the keys.
Reference : https://support.apple.com/en-in/HT204063