Login via Backend Service

In UI Builder, I cannot use the given “Login”-block, because I have to execute some logic before the actual login happens. I don’t want to expose this logic on the web client. Therefore, I’ve written an API Service, which internally uses the backendless login API.

However, how does the web client recognizes that the login has happened? I tried to return the user token from my API Service and then set it with the “Set current user token”-block in UI Builder. This has no effect.

Is there a way to let the web client recognize a login done within my API Service?

I know I could use a “before login” event handler, but maybe there is a way to do it with an API Service?


I think I solved it.
I’ve set the local storage key “Backendless_” in my browser. This seems to do the job.
Is this the right way to go?


There are should be user-token and current-user-id what been an objectId of the User entity. But not sure if it is the right way to do it.

May be will be better, if you invoke your API service, and return a boolean flag. If it’s true, do a standard login, if no - something else?