How to prevent auto logout and invalid token

How to prevent expo app from logging out everytime the app refreshes itself?

import * as SecureStore from 'expo-secure-store';

// Store auth token
export const storeToken = async (token: string) => {
    if (token !== null) {
        try {
            await SecureStore.setItemAsync('token', token);
            console.log('Token successfully stored');
            console.log(token);
        } catch (e) {
            console.log(e);
        }
    }
    else {
        try {
            await SecureStore.deleteItemAsync('token');
            await SecureStore.setItemAsync('token', token);
            console.log('Token successfully deleted')
        } catch (e) {
            console.log(e);
        }
    }
};

// Get auth token
export const getToken = async () => {
    try {
        let token = await SecureStore.getItemAsync('token');
        if (token !== null) {
            return token;
        }
        else {
            return null;
        }
    } catch (e) {
        console.log(e);
    }
};

// Remove auth token
export const removeToken = async () => {
    let token = await SecureStore.getItemAsync('token');
    try {
        if (token !== null) {
            await SecureStore.deleteItemAsync('token');
        }
        else {
            return null;
        }
    } catch (e) {
        console.log(e);
    }
};

I stored my token in SecureStore. When user log in, I called the storeToken function to store the token. And during logout, I called the removeToken function to remove the token. Both of these functions work as expected. But my issue is that the token seem to be removed or invalid whenever my app refresh the js bundle and in production also the token seems to be invalid when user re-enter the app. How can i handle this issue?