Going out to platform and back

The token (if it is present) is used automatically when the page makes API requests.

I get the user-token and send to my outside of platform page like this:

And the when I like to go back to this page inside the platform how to write the link?

https://www.targettacceso.com/?page=IngresoEgresoPersonas

Thanks,
Mario

PD Like this? I’m guessing… https://www.targettacceso.com/user-token:C2DC2BC0-6941-44E5-A636-5714CA3EAAC7/?page=IngresoEgresoPersonas&data=D9CEB29B-6B6A-4C2D-BD58-06EEC4457B40

You can write the link as:

?token=VALUE

When the page is loaded, PageData will have a property called token with the specified VALUE.

However, if you use persistent logins, I don’t think you need to do that because user-token is stored in local storage and when the user returns to the page, user token will already be there.

OK I write the following to test the user token:

This is the javascript taking care of the result of the QR code scanning (documento) and then go back to Backendless with the user-token from the starting page.

Back in Backendless this is the code ON Page Enter:

taking the objectId, data from the scan (documento) and the token (user-token) the result of the log is null for the Valid User Session and null the Get Current user. Why? I set the Current User token, I don’t like to login again… how to go back with the same user and continue the data input process ?

Screenshot 2023-03-02 at 15.57.42

Thanks, Mario

Hi Mario,

Could you please check if the user token value that when the user returns to the page is the same token that was there before the user went to an external page?

Regards,
Mark

This is the button to go to the QR scanning page:

and Yes is the same because at the button:

Screenshot 2023-03-02 at 17.05.35

And then coming back

Screenshot 2023-03-02 at 17.06.23

Any ideas how to be back and still with the user logged in?
Mario

To describe the problem. I’m here in this page with a user logged in with some information already selected by the user:

Screenshot 2023-03-02 at 18.03.42

The user click on Scan button to read a QR code and I sent to this page outside the platform:

With the QR scanner info I’m back to a transition page and that page must solve the user log in again and continue the process with the new data scanned.

And this page maybe not need a Continue button only for test.

Screenshot 2023-03-02 at 18.11.56

Thanks, Mario

What is the actual question or problem?

How to go back to the platform and still logged in ?
Because the Current User token not solved it’s null the Current user.
Mario

Sounds like we are starting over. The information already shared in this topic already has all the answers;)

This is your last message and my answer was It is the same but not working.
Mario

When the following call is made, please check in the Network tab of the browser’s DevTools what user token is used in the URL:

This could be the problem how to add user token at the URL ? Or how to write it?
Mario

That block automatically includes the token into the URL. I am asking to check what that token is.

OK, I can’t find the way to go back to the platform.

My solution in the middle time we have a QR reader at the Marketplace is close manually the external webpage and ask the user to update the information.

This solution it’s working but no good user interface and I can’t close the page programmatically when Backendless Viewer version.

Thanks, Mario

It would be helpful to get the information I asked for here.

The token is correct because I checked at the login as you explain at the Login video. Then the same token go to the platform and go back to the page but just set the Current User Token didn’t solve the issue to be at the same login session where I start the process. And I can ask to the user to login again.

Maybe could be good a simple example of how to use Set and Get Current User Token becase I didn’t find deep documentation just it’s working automatically inside the platform but how to handle coming from outside the platform?

Thanks, Mario

hello @Mario_Ghersi

if you coming outside of the platform, then it is your responsibility to keep auth token somewhere, and provide the token with subsequent requests.

Hi Sergey

Yes I have the user Token, but how to add again in my first entrances because inside the platform if I try to add with “Set Current User Token” is not working.

Thanks, Mario

Hi @Mario_Ghersi

Could you please create a test page with minimum UI/Logic to demonstrate the issue?