Quick doubts on afterLogin() - didn't find in any doc ??

Hi -
Can you plz help with below doubts - cant find the answers in any document.

  1. In afterLogin(), how can I invalidate the session - will the logout on the passed Backendless user work ??
  2. How can I return ‘my own error code’ from the afterLogin() - in order to identify the app ‘my own reason’ on why login is un-successful.
  3. Is there any way to pass ‘device ID’ in the login request - so as the same can be validated in afterLogin() ??
    Thanks.

Hi - Request for help on this. Thanks.

Hi Aditya,
Sorry for the delay.

  1. Yes, you can use logout() method
  2. You may throw BackendlessException with your custom code
  3. The best way would be to have ‘deviceId’ property in BackendlessUser object

Thanks - got it.

However, on third point - I would like to have the deviceId with which user is currently trying to login.
And while making login request - I only send userId and password.

Can there be any workaround ?

What you mean by “deviceId” ? It is your custom property ? What should it mean if so?
You can’t transfer you own properties in login() method.
But, for example, you can find out device type from users roles.