0

im trying to check if the given variable is true or not so i can show different links to the user

<f:if condition="{response.isAuthenticated} == true">
    <f:then>
        <a href="{response.logoutURL}">logout</a>
    </f:then>
    <f:else>
        <a href="{response.loginURL}">login</a>
    </f:else>
</f:if>

the above snippet always returns true

what am i doing wrong ?

im using TYPO3 6.1.3 this a part of an extension built with the extension manager

Daniel
  • 6,916
  • 2
  • 36
  • 47
alex
  • 646
  • 9
  • 19

3 Answers3

1

Did you try:

<f:if condition="{response.isAuthenticated}">

?

Mikhail Timofeev
  • 2,169
  • 15
  • 13
  • i have tried before at a certain point but it wasnt working but now it does thanks anyway :) – alex Dec 03 '13 at 14:22
1

Please try

<f:security.ifAuthenticated>
Your Code
</f:security.ifAuthenticated>

Worked for me using TYPO3 6.1.7

Philipp
  • 11
  • 1
-1
<f:if condition="{response.isAuthenticated}">
        <f:then>
            <a href="{response.logoutURL}">logout</a>
        </f:then>
        <f:else>
            <a href="{response.loginURL}">login</a>
        </f:else>
</f:if>
Ajay Gohel
  • 128
  • 12
  • This should be avoided *unless* the action is either not cached or the page including arguments gets cached with a unique cHash for each user. Otherwise subsequent visitors will see protected content. The correct way is ``. – Claus Due Sep 03 '16 at 01:15