Get the checkout ID so I can redirect back

Hey all,

I want to be able to extract the following part of the checkout URL so I can redirect users back after they have logged in:

https://store.com/50750783690/checkouts/952e5e3e74515a49dfc3c280d2df6e4d

Is there an easy way to expose this on the customers/login page using liquid? If not is there a way to get the whole URL so I can extract it using JS?

Cheers, Elliott.