I like the approach and implemented it on server-side without doing any authentication related thing on front-end
My 'technique' on my latest app is.. the client doesn't care about Auth. Every single thing in the app requires a login first, so the server just always serves a login page unless an existing user is detected in the session. If session.user is found, the server just sends index.html. Bam :-o
Look for the comment by "Andrew Joslin".