How to maintain the user authenticated in a SPA with custom login?

There’s been some progress and some libraries code have received some changes with regards to this, but there’s still no formal documentation so it’s not yet complete and final.