it because you are log in not existed user.
Register-page work user:kol@abv.bg
Logout -page work
Backendlles-database you have kol@abv.bg
Login-page not work
POST https://stronglove.backendless.app/api/users/login 400 (Bad Request)
here it register:
curl -X POST https://stronglove.backendless.app/api/users/register -d '{"email":"q@q.com", "password":"123qwe"}' -H "Content-Type:application/json"
{"lastLogin":null,"userStatus":"ENABLED","created":1638889997751,"accountType":null,"ownerId":"503C8F9C-EE81-4696-A677-41ABB55A950D","socialAccount":null,"oAuthIdentities":null,"name":null,"___class":"Users","blUserLocale":"en","updated":null,"objectId":"503C8F9C-EE81-4696-A677-41ABB55A950D","email":"q@q.com","username":null}
and it work.
And here it is login:
curl -X POST https://stronglove.backendless.app/api/users/login -d '{"login":"q@q.com", "password":"123qwe"}' -H "Content-Type:application/json" -i
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 07 Dec 2021 15:14:25 GMT
Content-Type: application/json
Content-Length: 406
Connection: keep-alive
Set-Cookie: user-auth-cookie-719CA8EC-817E-9E1F-FF2E-561A9FD29100=E46BD5CD-EB48-4A20-A4BF-3A7CC45D730F; Max-Age=2147483647; Expires=Sun, 25 Dec 2089 18:28:32 GMT; SameSite=Strict; Path=/; HTTPOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE, PATCH
Strict-Transport-Security: max-age=31536000; preload
{"lastLogin":1638890065443,"userStatus":"ENABLED","created":1638889997751,"accountType":"BACKENDLESS","ownerId":"503C8F9C-EE81-4696-A677-41ABB55A950D","socialAccount":"BACKENDLESS","oAuthIdentities":null,"name":null,"___class":"Users","blUserLocale":"en","user-token":"E46BD5CD-EB48-4A20-A4BF-3A7CC45D730F","updated":null,"objectId":"503C8F9C-EE81-4696-A677-41ABB55A950D","email":"q@q.com","username":null}
and it works too
export const loginIn = (login, password)=>{
return fetch(`${baseUrl}/users/login`,{
method:'POST',
headers:{
'content-type': 'application/json'
},
body:JSON.stringify({login, password})
}).then(res=> res.json()).then(err=>console.error(err))
}
export const register = (email, password) => {
return fetch(`${baseUrl}/users/register`, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({ email, password })
})
.then(res => res.json());
};
register now
-
{lastLogin: null, userStatus: “ENABLED”, created: 1638892113318, accountType: null,…}
-
accountType: null
-
blUserLocale: “en”
-
created: 1638892113318
-
email: “ko23@gmail.com”
-
lastLogin: null
-
name: null
-
oAuthIdentities: null
-
objectId: “5B1CEB6D-599C-4AC2-A807-C4A5C19A2129”
-
ownerId: “5B1CEB6D-599C-4AC2-A807-C4A5C19A2129”
-
socialAccount: null
-
updated: null
-
userStatus: “ENABLED”
-
username: null
-
___class: “Users”
I enter register user: “ko45@gmail.com” and password “1234567”
and register status ok 200 but column PayLoad
{email: “ko45@gmail.com”, password: “gf”}
email: “ko45@gmail.com”
password: “gf”
Why is this happening
after login with ko45@gmail.com and password: gf
Request URL:
https://stronglove.backendless.app/api/users/login
Code:
200 OK
- Access-Control-Allow-Methods:
POST, GET, OPTIONS, PUT, DELETE, PATCH
- Access-Control-Allow-Origin:
- Connection:
keep-alive
- Content-Encoding:
gzip
- Content-Length:
284
- Content-Type:
application/json
- Date:
Tue, 07 Dec 2021 16:16:56 GMT
- Server:
nginx
- Strict-Transport-Security:
max-age=31536000; preload
- user-token:
36C4450A-C7C2-40E9-8282-7A7CBE9EE444
- Vary:
Accept-Encoding
Hello @Grozdan_Gospodinov
Regarding the situation with the password:
- Did the problem reproduce itself only once?
- Have you tried registering the user via the REST console?
- Have you tried using the project in Codegen to register and login? Monosnap
You originally wrote about the login not working, but as I can see, the user login ko45@gmail.com is working.
Regards,
Inna