<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-action>#{auth.authenticate(username)}</from-action>
<if>#{auth.logged}</if>
<to-view-id>/tasks.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/tasks.xhtml</from-view-id>
<navigation-case>
<from-action>#{auth.logout}</from-action>
<if>#{!auth.logged}</if>
<to-view-id>/index.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>