PHPackages                             pechente/kirby-password-guard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. pechente/kirby-password-guard

ActiveKirby-plugin[Security](/categories/security)

pechente/kirby-password-guard
=============================

Kirby Password Guard

1.4.0(3w ago)386.5k↓50.5%[3 issues](https://github.com/Pechente/kirby-password-guard/issues)MITPHPPHP &gt;=8.0.0

Since Oct 25Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Pechente/kirby-password-guard)[ Packagist](https://packagist.org/packages/pechente/kirby-password-guard)[ Docs](https://github.com/Pechente/kirby-password-guard/)[ RSS](/packages/pechente-kirby-password-guard/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

Kirby Password Guard
====================

[](#kirby-password-guard)

**Kirby Password Guard** is a simple password protection for your [Kirby](https://getkirby.com/) website. It allows you to set a password that needs to be entered in order to access the site. This can be useful for staging sites to prevent unwanted access. Logged in users can access the site normally but any guest will run into the password entry page.

[![kirby-password-guard](https://private-user-images.githubusercontent.com/5963497/380140032-2e4596a7-56a9-4084-8b5c-4c3358e4f34c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODU3MDYwMjQsIm5iZiI6MTc4NTcwNTcyNCwicGF0aCI6Ii81OTYzNDk3LzM4MDE0MDAzMi0yZTQ1OTZhNy01NmE5LTQwODQtOGI1Yy00YzMzNThlNGYzNGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNT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lPWltYWdlJTJGcG5nIn0.VM7xUom6piqVBDCmuTqvpajdtXyKRz15ykcbomiHr0g)

---

Installation
------------

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/kirby-password-guard`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/pechente/kirby-password-guard.git site/plugins/kirby-password-guard

```

### Composer

[](#composer)

```
composer require pechente/kirby-password-guard

```

Setup
-----

[](#setup)

### Configuration

[](#configuration)

Add the following lines to your config.php:

```
return [
    'pechente.kirby-password-guard' => [
        'enabled' => true, // Optional - default is true
        'password' => 'password', // Required - The password used to access the site. If left empty the plugin will not be enabled.
        'pattern' => '(:all)', // Optional - The pattern to protect. By default, all pages are protected. Check the Kirby documentation for more information.
        'nonce' => true, // Optional - default is true. Adds Kirby's per-request nonce ($kirby->nonce()) to the password prompt's inline  and  tags, so they keep working under a strict CSP (style-src/script-src without 'unsafe-inline') as long as you add 'nonce-' . $kirby->nonce() to that CSP header yourself. Disable if you don't want the nonce attribute added.
    ]
];
```

### Template

[](#template)

You can overwrite the template for the password form by creating the file `site/templates/password-guard.php`. Here's a minimal example of what this file needs to include:

```
DOCTYPE html>
