Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get to work on staging looking for tips to troubleshoot #64

Open
sg-modlab opened this issue Apr 12, 2023 · 2 comments
Open

Can't get to work on staging looking for tips to troubleshoot #64

sg-modlab opened this issue Apr 12, 2023 · 2 comments
Labels

Comments

@sg-modlab
Copy link

Question

Do you have any tips to troubleshoot this not working on staging?

Additional context

We use Knock Knock on a host of sites to protect access on our staging server. All to date have been working great with no issue. I have a redesign site that we recently pushed to staging for review and Knock Knock is not working on staging. There are no errors and I'm a little baffled by it. There is a single site.

I am using the config copied direct from the docs.

Locally my .env is set to dev.

ENVIRONMENT=dev

When i change my knock-knock.php config to the following:

'dev' => [ 'enabled' => true, ],

The site is properly locked. Yeah!

When I change config back to:

'staging' => [ 'enabled' => true, ],

and then update my .env to:

ENVIRONMENT=staging

The site is not locked. Boo!

This in essence is what I am seeing on my actual staging server. Struggling to find a cause so thought I'd reach out for troubleshooting advice.

@engram-design
Copy link
Member

Can't think of a reason why that wouldn't work (it's working for me with that reduced case. Only thing worth considering is that if you're logged in, it'll bypass the challenge screen?

I'd also just double check all your other Knock Knock settings just in case.

@eddiedale
Copy link

Not sure if relevant in this case, but thought I'd mention it in case it is:
I had the issue with knock knock not locking a page in production, but working fine locally.

The reasoning was that the BASE_URL was not the same as the accessed url.
Specifically I was hosting the site at Fortrabbit, and had previously used their given url projectname.frb.io, and only recently routed the correct domain. Thereafter I had added a htaccess redirect from the frb.io domain to the actual domain, but forgotten to change the BASE_URL.

Obviously an error on my side, but worth mentioning just in case someone else also do the same 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants