Permit.js

Demo Simple Login

This page demonstrates a simple login simulation. In this example, the page URL does not change when switching between the logged-in and logged-out states. But a multi-page implementation is just as easy.


The Code

HTML
<div class="permit permit-none">
	<p class="alert alert-info">You're not logged in.</p>
	<a href="#" class="btn btn-primary permit-issue-members">Log in</a>
</div>
<div class="permit permit-members">
	<p class="alert alert-success">Now you're logged in.</p>
	<a href="#" class="btn btn-danger permit-revoke-all">Log Out</a>
</div>
Javascript
$(document).ready(function()
{
    $.permit(
        {permits: ['members']}
    );
});

You're not logged in.

Log in

Now you're logged in.

Log Out