Grokking React Native
0% completed
Authenticated Requests and Token Expiry
Saving a token tells the server nothing until the token travels with a request. The previous lesson built LoginScreen, which posts the email and password, and a small App that saves the returned token with expo-secure-store. This lesson continues from that code. It sends the token with each request, shows a profile screen, restores the login after a restart, and handles expiry and logout.
Two values from the previous lesson appear throughout the code below:
const apiClient = axios.create({ baseURL: 'https://api.example.com', timeout: 5000, });
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%