1000 Error

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)

@Grozdan_Gospodinov

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());

};

https://stronglove.backendless.app/api

register now

  1. {lastLogin: null, userStatus: “ENABLED”, created: 1638892113318, accountType: null,…}

  2. accountType: null

  3. blUserLocale: “en”

  4. created: 1638892113318

  5. email: “ko23@gmail.com

  6. lastLogin: null

  7. name: null

  8. oAuthIdentities: null

  9. objectId: “5B1CEB6D-599C-4AC2-A807-C4A5C19A2129”

  10. ownerId: “5B1CEB6D-599C-4AC2-A807-C4A5C19A2129”

  11. socialAccount: null

  12. updated: null

  13. userStatus: “ENABLED”

  14. username: null

  15. ___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

  1. Access-Control-Allow-Methods:

POST, GET, OPTIONS, PUT, DELETE, PATCH

  1. Access-Control-Allow-Origin:

http://localhost:3000

  1. Connection:

keep-alive

  1. Content-Encoding:

gzip

  1. Content-Length:

284

  1. Content-Type:

application/json

  1. Date:

Tue, 07 Dec 2021 16:16:56 GMT

  1. Server:

nginx

  1. Strict-Transport-Security:

max-age=31536000; preload

  1. user-token:

36C4450A-C7C2-40E9-8282-7A7CBE9EE444

  1. 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