Macbook restarts when logging in
Try discharging the battery (plug in an iPhone or iPad or whatever and drain the battery by charging it). Then reset the PRAM and SMC. Finally start up in verbose mode (hold V while booting) and try to capture what gets displayed (iPhone or iPad video works well).

After the battery has been effectively dead for a day (it should be dead enough that when you hit the power button it only shows a "plug in charger" pictogram, give it a little charge and there's a good chance your Mac will act properly. If not, the verbose console log will be useful.