andrekelling/kirby-force-login
Force Login
Maintainers
Package info
github.com/AndreKelling/kirby-force-login
Type:kirby-plugin
pkg:composer/andrekelling/kirby-force-login
1.1.0
2026-06-18 09:16 UTC
MIT f729416c3402600ea2f49874c4f042bf6efea524
- André Kelling <kontakt.woop@andrekelling.de>
README
A plugin for Kirby CMS.
- forces all users to login on non-panel pages
- redirects back to blocked page via urlParam after login
Especially useful for staging websites.
Inspired by WordPress plugin - Force Login
Requirements
- Kirby 5.1+ (just tested with 5.1 probably works on previous versions too)
Installation
Download
Download and copy this repository to /site/plugins/kirby-force-login.
Composer
composer require andrekelling/kirby-force-login
Usage
andrekelling.force-login.is-active supports bool and callable values in your config (for example in site/config/config.php).
Bool example
return [ 'andrekelling.force-login' => [ 'is-active' => true, ], ];
Callable example
The callable should return true or false depending on your runtime checks.
return [ 'andrekelling.force-login' => [ 'is-active' => function (): bool { if (!defined('SOMETHING') || SOMETHING !== true) return false; $path = (string) kirby()->request()->path(); if (in_array($path, ['somepath', 'other/path', 'whatever/path.html'], true)) return false; return true; }, ], ];
License
MIT License Copyright © 2025 André Kelling
