Comments (5)
What do you mean by public site?
Here is the documentation for user authentication: http://strapi.io/documentation/users
from strapi.
Using POST /auth/local/register I get back the newly created user and jwt.
Using POST /auth/local/login with the same users filled in credentials:
{
"identifier": "[email protected]",
"password": "123456"
}
I get back a 400:
http://localhost:1337/auth/local/login Failed to load resource: the server responded with a status of 400 (Bad Request)
from strapi.
By public site I mean, not the admin section.. The project root index.html.
Script:
$.ajax({
type: "POST",
url: '/auth/local/register',
data: {
username: "bobbybrown123",
email: "[email protected]",
password: "bobbybrown123"
},
success: function(response) {
console.log(response) // works returns user
}
});
// executed after user is created, 400 response
$.ajax({
type: "POST",
url: '/auth/local/login',
data: {
identifier: "[email protected]",
password: "bobbybrown123"
},
success: function(response) {
console.log(response)
}
});
from strapi.
Ok I've figured it out. The documentation http://strapi.io/documentation/users#local-login says /auth/local/login but when I viewed the network request of logging in from admin it is actually /auth/local
Maybe it's an error in the documentation?
from strapi.
Good catch, @sylvainlap just made a pull request to update the documentation : strapi/strapi-docs#2
Thanks @gregbenner @sylvainlap
from strapi.
Related Issues (20)
- Content history "back" link doesn't work
- Relation fields issue of Strapi upgrade
- Error when creating new collection type HOT 1
- the Admin panel always thinks its outdated HOT 1
- Possibility for Basic Auth HOT 3
- Cannot delete a collection item after renaming a component category
- Viewing unused images in Strapi HOT 1
- "Add new API token" button has not the right style HOT 1
- Error When Deploying to Strapi Cloud
- Editing a token opens a new admin tab HOT 1
- Invalid String Length HOT 1
- “site can't be reached” flicker after saving a content type HOT 1
- Can add two attributes with the same name and save HOT 1
- Casing in component display name not respected HOT 1
- Long titled Collection Type breaks buttons display
- REST API filters $contains operator not working in Strapi Cloud environment
- Strapi fetches old single type data randomly
- [missing feature] Doesn't V4 "Fill in from another locale feature" exist in V5 so far ? HOT 1
- Copying content from blocks doesn't work as expected
- There is no problem when uplodding the media library, but if I want to change the logo i get error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strapi.