Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Created August 6, 2014 13:30
Show Gist options
  • Save DeskWOW/a291e186aa7408255f57 to your computer and use it in GitHub Desktop.
Save DeskWOW/a291e186aa7408255f57 to your computer and use it in GitHub Desktop.
Private Portal — Require specific user email address domain to allow support center access
{% unless current_user == nil or current_user.is_guest %}
{% assign email_domain = current_user.customer.email | split: '@' %}
{% if email_domain[1] contains "sitechcs.com" %}
Success! You'll want ALL code currently in your 'Layout' to go here so the site loads.
{% else %}
If the user sees this text, it means they logged in, but their email domain isn't approved.
{% endif %}
{% else %}
If the user sees this text, it means they are not logged in. So you'll likely want to prompt them to login or auto redirect them to login page here.
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment