Skip to main content

Mobile Backend user context

Mobile backend user context is loaded by injetUserToContext. It is executed on each call to the Mobile Backend.

This function is in charge of validating the JWT token that comes in Authorization header, and loads user data from cache or database.

JWT token is generated by login mutation and stored in the Mobile App. It is used to authenticate the user on each call to the Mobile Backend.

JWT is send on Authorization header as bearer token.

injetUserToContext extracts the token from header and verifies it, if it is valid, it reads the user uid contained on it. uid is then used to retrieve user data from cache or database.