Redirect user to language site of choice On this multi-language site (NL, FR, EN) we're using the saml plugin to single sign on users into the craft site. That part is working fine. Every user has a preferred lanuage returned into a user custom field userLanguage.
What I'm trying to do is simply redirect the French language users to https://mysite.com/fr and the English language users to https://mysite.com/en
In my index template I have the following

{% requireLogin %}

{% if currentUser %}
    {% switch currentUser.userLanguage %}

      {% case "NL" %}
        {% redirect 'https://mysite.com'  %}
      {% case "FR" %}
        {% redirect 'https://mysite.com/fr'  %}
      {% case "EN" %}
        {% redirect 'https://mysite.com/en'  %}    
      {% default %}
         {% redirect 'https://mysite.com'  %} 

    {% endswitch %}
{% endif %}
{# rest of homepage template here #}


On visiting https://mysite.com/ I'm redirected to the sso page and after login back to https://mysite.com/ and there I get a "too many redirects" error, in firefox it's "The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
What am I missing here?
The answer here was to redirect to another url using a different template rather than hitting the index template again, which was what was causing the loop.