User logged in, external backend

Hey,

I have my first experiences with bubble itself so I wanted to experiment with external backend, Xano in this case.

The main problem I’m facing now is what to do to with the User object after successful login. The goal is to have funcionality like bubble has natively, which is being able to check if user is logged in and store his data somewhere (without asking database each time).

My flow for now looks like this:

  1. user provides credentials. Request to xano is send.
  2. I recieve a token and store it in local storage.
  3. I send a request, with the token, to xano to get user details. I get back the User object.
    All of these was easy to achieve as xano has some nice tutorials covering it.

My question is what are good practices to do next?

  1. Where do I store the User object to have it accesable all the time. I want to use it somehow like in bubble ‘if user is logged in’.
  2. In case the token expired and user is sending the request to Xano, the backend returns the error (as expected). How to handle that in bubble:
    a) remove User object stored in the 1 question and remove token from local storage
    b) how to implement funcionality of always navigating to login or home page if token is expired? Ofc I don’t want to manually program it with each workflow method.

Thank you :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.