get template switching working in authenticate filter