Reputation: 273
I'm trying to build a basic one-page site that is restricted to members only. However, I can't seem to get the User plugin working. Below are the following two pages that I thought I would need to accomplish this:
Home (home.htm)
title = "Site name"
url = "/"
layout = "default"
is_hidden = 0
[session]
security = "all"
==
{% component 'session' %}
{% if user %}
<p>Hello {{ user.name }}</p>
{% else %}
<p>Nobody is logged in</p>
{% endif %}
Login (login.htm)
title = "Login"
url = "/login/:code?"
layout = "default"
is_hidden = 0
[account]
redirect = "home"
paramCode = "code"
==
<?php
function onStart() {
//dump($this);
Flash::success('Flash working!');
}
?>
==
{% partial 'messages' %}
{% component 'account' %}
Some things to note:
{% page %}
All of that being said, the issue is that I'm going to the following URL (if I'm running via php artisan serve
): http://localhost:8000/login and try to login with some user I have setup. I have made sure they are activated. Registration is disabled. Throttling is disabled. Activation required is disabled. But I put the credentials into the login form and then am taken to: http://localhost:8000/login?login=username&password=password
Any advice would be awesome. I feel like I'm missing something so stupid and so small.
Upvotes: 0
Views: 1447
Reputation: 273
Solved it today thanks to October chat. The issue was this was missing the AJAX framework provided with October. Basically in October a "valid" theme uses the built in Jquery/AJAX frameworks with October. This is the code I had to add to the layout to get things rolling:
<script src="{{['@jquery','@framework']|theme}}" ></script>
Upvotes: 2