Password Protected Store - People can still access with direct link

Highlighted
New Member
5 0 0

Hello,

I've set up our store to be password protected. Only those customers who have been "Approved" can access the site. We've done this as a means to combat fraudulent purchases.

However, if someone has a direct url to one of our products, they can still access it. We discovered this because we had another fraudulent purchase yesterday. How can I lock down the individual product pages?

This is what I have now at the very top of my theme.liquid:

Thanks!

{% unless customer.tags contains 'Approved' %}
    {% if template contains 'customers' %}
        {% assign send_to_login = false %}
    {% elsif template contains 'collection' %}
        {% assign send_to_login = true %}
    {% endif %}

{% endunless %}

{% if send_to_login %}
<meta content="0; url=/account/login?checkout_url={{ shop.url }}" http-equiv="refresh" />


{% else %}
0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
338 0 55

Hi Sarah,

I tried this on my test shop and it seemed to work!

{% unless customer.tags contains 'Approved' %}
    {% if template contains 'customers' %}
        {% assign send_to_login = false %}
    {% elsif template contains 'collection' %}
        {% assign send_to_login = true %}
	{% elsif template contains 'product' %}
		{% assign send_to_login = true %}
    {% endif %}

{% endunless %}

{% if send_to_login %}
<meta content="0; url=/account/login?checkout_url={{ shop.url }}" http-equiv="refresh" />


{% else %}

Cheers!

Alicia | Support Lead for Shopify
0 Likes
Highlighted
New Member
5 0 0

THANK YOU!!!

 

0 Likes
Highlighted
Shopify Partner
5 0 0

I've been trying to accomplish the same except I can't seem to push customers to the homepage once they login. They are always forwarded to their account page. I tried putting this in the login.liquid template:


<input type="hidden" name="checkout_url" value="/" />

 

0 Likes
Highlighted
Shopify Partner
17 1 3

If you just want to add a password to a specific section of the site you can use the MagicPass app. It doesn't require Shopify user accounts or admin approval. Just thought I'd mention it!

0 Likes
Highlighted
Tourist
7 0 1

What do you mean by fraudulent purchase please?

0 Likes