I am using React Native Firebase Auth, however my user profiles are actually stored in my relational database. Because of this, I have mapped the Firebase uid => PostgreSQL integer id. (Thinking of just using uid for everything to keep it simple instead of mapping to an id in my own db)?
Anyway, when my React Native app launches, my user is logged in through Firebase, and I get a response back with info like uid
, refresh_token
, etc.
How should I get and pass this user's token to my backend Node.js server to get their profile? It only seems like there is refresh_token
from the auth response, which I shouldn't pass.
Currently, I am just passing the uid
Firebase Auth gives to my backend server, assuming that's "secure enough" since they got it from logging in. Is this sufficient? I feel like I should pass some token -> decode it on the server -> get the uid?
If so, how to do this?