PHPackages                             vojtasvoboda/oc-codelogin-plugin - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. vojtasvoboda/oc-codelogin-plugin

ActiveOctober-plugin[Authentication &amp; Authorization](/categories/authentication)

vojtasvoboda/oc-codelogin-plugin
================================

Code login plugin for OctoberCMS

1.0.6(6y ago)8116[1 PRs](https://github.com/vojtasvoboda/oc-codelogin-plugin/pulls)MITPHPPHP &gt;=5.5.9

Since Apr 1Pushed 3y ago2 watchersCompare

[ Source](https://github.com/vojtasvoboda/oc-codelogin-plugin)[ Packagist](https://packagist.org/packages/vojtasvoboda/oc-codelogin-plugin)[ Docs](https://github.com/vojtasvoboda/oc-codelogin-plugin)[ RSS](/packages/vojtasvoboda-oc-codelogin-plugin/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (6)Used By (0)

Code Login for OctoberCMS
=========================

[](#code-login-for-octobercms)

[![Codacy](https://camo.githubusercontent.com/a00a1a78c25c422c7f08d569cd775a4a0566f6aa4fd6e5cc07bffe4043c9f3de/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f64616636613965626430333534306165623361663766663163346466663863652e737667)](https://www.codacy.com/app/vojtasvoboda/oc-codelogin-plugin)[![Scrutinizer Coverage](https://camo.githubusercontent.com/1c344970c1c54946d37a9a254551756f88250d4b8b1a17670e004cfd4ea9574d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f766f6a746173766f626f64612f6f632d636f64656c6f67696e2d706c7567696e2e737667)](https://scrutinizer-ci.com/g/vojtasvoboda/oc-codelogin-plugin/?branch=master)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/vojtasvoboda/oc-codelogin-plugin/blob/master/LICENSE.md)

Login only by code or password. Create secret page or protect whole site just in minute. Tested with the latest stable OctoberCMS build 349.

Dependencies
------------

[](#dependencies)

RainLab.User plugin for users management.

How to create secret page
-------------------------

[](#how-to-create-secret-page)

1. Install RainLab.User plugin and then [VojtaSvoboda.CodeLogin](http://octobercms.com/plugin/vojtasvoboda-codelogin) plugin.
2. Insert RainLab.User Session component to layout which you want to protect by code.

 [![Screenshot of Session component placed at layout](assets/images/1-place-session-component.png)](assets/images/1-place-session-component.png)

Set Allow property only for Users (means logged users) and then set your login page. All guests will be redirect to login page.

Be sure you have injected JavaScript code and jQuery to your layout:

```

{% framework %}
{% framework extras %}

```

Framework extras tag is optional and this tag adds a CSS and JavaScript files that contain the loading indicator plugin and CSS classes for styling the loading indicator. The indicator is displayed on the top of the page when an AJAX request runs.

2. Create login page with Login layout and insert RainLab.User Session component and Code login form. Session component set to Allow only guest (login allowed only for guests). CodeLogin provide login form and session component will redirect user when already logged.

 [![Screenshot of Login page with Session and Code login form](assets/images/2-create-login-page.png)](assets/images/2-create-login-page.png)

Set redirect parameter to your secret page and then set if you want to use input type text or input type password (code will not be visible).

 [![Screenshot of Login form with visible password](assets/images/3-password-visible-or-not.png)](assets/images/3-password-visible-or-not.png)

3. Use default HTML or create own design by extending component template:

- create file `/partials/codeLogin/default.htm`
- copy content from original component template `/components/codelogin/default.htm`
- add classes or HTML you needed

 [![Screenshot of custom designs](assets/images/4-create-your-own-design.png)](assets/images/4-create-your-own-design.png)

4. At RainLab.User plugin create as many users as you want. It's recommanded to use unique password for each user, because first user with matched password will be log!
5. \[optional\] If you want create logout page, just create logout.htm, insert session component allowed for logged user and with redirect to login page. To the template paste this code:

`Sign out`

6. \[optional\] For logging all user accesses use [UserAccessLog](http://octobercms.com/plugin/vojtasvoboda-useraccesslog) plugin.
7. \[optional\] For creating more user accounts use [User import/export](http://octobercms.com/plugin/vojtasvoboda-userimportexport) plugin - just create simple XLS file with usernames and import it (passwords can be generated by [Norton Password Generator](https://identitysafe.norton.com/password-generator/)).

Events
------

[](#events)

After successfull login you can use `rainlab.user.login` event to catch logged user instance:

```
Event::listen('rainlab.user.login', function ($user) {
    dump($user);
});

```

Troubleshooting
---------------

[](#troubleshooting)

### Login button doesn't works.

[](#login-button-doesnt-works)

Be sure you have included jQuery and `{% framework extras %}` code to your layout (not to page).

### AJAX handler 'codeLogin::onCodesignin' was not found.

[](#ajax-handler-codeloginoncodesignin-was-not-found)

If form doesn't work, try to insert Code login component to page, not to partial. Login component should be placed beside to Session component.

Future plans
------------

[](#future-plans)

- can change login form input field text
- code preset with GET parameter e.g. /login?code=abcde
- unit test for logging method

**Feel free to send pullrequest!**

License
-------

[](#license)

Code login plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT) same as OctoberCMS platform.

Contributing
------------

[](#contributing)

Please send Pull Request to master branch.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 93.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~336 days

Total

5

Last Release

2395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/533ab9a0897c6c6754ac9baf2ad6e42ecbc2a57aa67c72b885fcc647c7ae6930?d=identicon)[VojtaSvoboda](/maintainers/VojtaSvoboda)

---

Top Contributors

[![vojtasvoboda](https://avatars.githubusercontent.com/u/374917?v=4)](https://github.com/vojtasvoboda "vojtasvoboda (27 commits)")[![gergo85](https://avatars.githubusercontent.com/u/2959112?v=4)](https://github.com/gergo85 "gergo85 (1 commits)")[![joey-i](https://avatars.githubusercontent.com/u/6063239?v=4)](https://github.com/joey-i "joey-i (1 commits)")

---

Tags

octobercms-pluginplugincodeuserloginoctober

### Embed Badge

![Health badge](/badges/vojtasvoboda-oc-codelogin-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/vojtasvoboda-oc-codelogin-plugin/health.svg)](https://phpackages.com/packages/vojtasvoboda-oc-codelogin-plugin)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k17.8M58](/packages/lab404-laravel-impersonate)[rainlab/user-plugin

User plugin for October CMS

11854.7k15](/packages/rainlab-user-plugin)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[lab404/laravel-auth-checker

Laravel Auth Checker allows you to log users authentication, devices authenticated from and lock intrusions.

223166.7k2](/packages/lab404-laravel-auth-checker)[rickycezar/laravel-jwt-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

24122.8k](/packages/rickycezar-laravel-jwt-impersonate)[winter/wn-user-plugin

User plugin for Winter CMS

1237.1k16](/packages/winter-wn-user-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
