Made loginRequired.template independent of loginRequired.shouldRoute

Code block for setting custom layout is not in the right place. Moved it out of the if block for shouldRoute checking.

Setting layout is now independent of shouldRoute.