Support Topics Documentation Slack YouTube Blog

JS SDK Multi Login Bug

Hi,

When the backendless app is configured to disable multiple logins and when a secondary login occurs, notify and logout FIRST user:

a secondary login via the js sdk produces user already logged in error. Same scenario works as expected via rest api. Issue only relates to js sdk logins via Backendless.UserService.login

Here’s the error from secondary login via js sdk:
**{"message":"User is already logged in from another device/computer. The application is configured to disable multiple concurrent logins with the same user credentials.","code":3002,"status":400,"headers":{"access-control-allow-methods":"POST, GET, OPTIONS, PUT, DELETE, PATCH","access-control-allow-origin":"*","connection":"keep-alive","content-length":"196","content-type":"application/json","date":"Thu, 09 Jul 2020 13:00:49 GMT","server":"nginx","strict-transport-security":"max-age=31536000; preload"},"body":{"code":3002,"message":"User is already logged in from another device/computer. The application is configured to disable multiple concurrent logins with the same user credentials.","errorData":{}},"line":15,"column":24741,"sourceURL":"https://api.backendless.com/sdk/js/latest/backendless.min.js"}**

Hi @Sean_Butler,

We’ll take a look at this and back to you as soon as possible.

Best regards,
Yevgen

@Sean_Butler,

Could you be so kind to provide us a code sample that you use?

Thank you in advance.

Hi, see below:

Backendless.initApp( "xxx-xx-xx-xx-xxxx", "xxx-xx-xx-xxx-xxx" );
Backendless.UserService.login( login, password, true )
 .then( function( loggedInUser ) {

   })
 .catch( function( error ) {
   });

Hello, @Sean_Butler, can you provide your application id?

Regards, Nikita.