This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi Everyone,
I am working with the Rainlab Front-end User Plugin and started to build a login page. Everything seems to work fine, but somehow the AJAX actions don't work. I still get the window alert() messages and an error message in the console:
Failed to load resource: the server responded with a status of 406 (Not Acceptable)
I have the {% framework extras %} and {% scripts %} added to the page and jQuery is loaded. I tried to do the same with the demo theme and it didn't work either - same error. Other AJAX parts do work fine. I am working on a local environment (xampp).
Does anybody have an idea what the issue could be? Any help is appreciated!
Can you share your markup for the login form?
It might be that you're not using the correct field names in the form - as I think a 406 Not Acceptable might be being used as a valdation failed response.
Thanks for your answer, here is my markup for the login form:
title = "Login"
url = "/login"
layout = "default"
is_hidden = 0
[account]
redirect = "homepage"
paramCode = "code"
forceSecure = 0
[session]
security = "all"
==
{% if not user %}
<div class="row">
<div class="col-md-6">
<h3>Anmelden</h3>
{{ form_ajax('onSignin') }}
<div class="form-group">
<label for="userSigninLogin">{{ loginAttributeLabel }}</label>
<input name="login" type="text" class="form-control" id="userSigninLogin" placeholder="Email" />
</div>
<div class="form-group">
<label for="userSigninPassword">Password</label>
<input name="password" type="password" class="form-control" id="userSigninPassword" placeholder="Passwort" />
</div>
{% flash %}
<div class="alert alert-{{ type == 'error' ? 'danger' : type }}">{{ message }}</div>
{% endflash %}
<button type="submit" class="btn btn-default">Einloggen</button>
{{ form_close() }}
</div>
</div>
{% else %}
{% partial account ~ '::activation_check' %}
{% partial account ~ '::update' %}
{% partial account ~ '::deactivate_link' %}
{% endif %}
Yes, I am using the default handler of the plugin. Even if I use the standard component {% component 'account' %}, it doesnt work.
You most likely have a JavaScript error somewhere in your project.
Check your browser JavaScript console for errors.
I did and excluded all the other Javascript files from the page. Only jQuery is left. All I get in the console is: Failed to load resource: the server responded with a status of 406 (Not Acceptable)
Yes, I just tried it out with a clean install and the demo theme. Same 406 error again. Am I missing out on something? Installing october, installing the user plugin and after that I created a new CMS page (default Layout from the demo theme) and included the {% component 'account' %} on the page.
Hi everyone,
I have the same issue with the front-end forms of user-plugin on my local server (XAMPP). Although, I can register, and sign in perfectly fine, but the following error, keeps popping up on my console: "xxx POST http://localhost/test/login 406 (Not Acceptable)"
It is really confusing to decide which JS or CSS library I need to include and how, especially when it comes to Bootstrap CSS, and its associated JS files!
If you were able to resolve that issue, I wish you can share the solution. Thank you
If you go to the network tab in Dev tools, click on the login button. And look at the failed response in there. It should give you more details on what's missing and why you're getting a 406 error.
Thank you @neilcarpenter for your reply. I can't figure out the source of the issue, but I have doubts in the JQuery file.
On my Network tab, the only failed response is the login page, with the following header:
Request URL: http://localhost:3000/test/login Request Method: POST Status Code: 406 Not Acceptable Remote Address: [::1]:3000 Referrer Policy: strict-origin-when-cross-origin
Note: I am using Laravel-Mix, would it be the reason of how MIX is combining my JS files?
1-12 of 12