User is logged out after one day


I use the React Native SDK to signup/login the user. The user gets logged out automatically the next day when he opens the app again. I have set all the limits to maximum allowed in auth0 config. PFA screenshot. I would like the user to be logged in for atleast 15 days.

Here is the code snippet

import { useAuth0 } from ‘react-native-auth0’;

const { user, isLoading } = useAuth0();



useFocusEffect(
    useCallback(() => {
        checkUserAuth()
    }, [])
)

useEffect(() => {
    if (!isLoading) {
        checkUserAuth()
    }
}, [isLoading])

const checkUserAuth = async () => {
const token = await AsyncStorage.getItem(‘user_token’)
if (!token) {
moveUserToLoginPage()
}

    if (isLoading) {
        return
    }
    try {
        if (user) {
            setLoading(true)
            actions.GetDashboard({})
        } else {
            await moveUserToLoginPage()
        }
    } catch (e) {
        console.error('error in checkUserAuth', e)
        setLoading(false)

    }
}

I tired printing the refresh token and its null after doing a fresh login.

    const credentials = await getCredentials()

“Null here in the refresh token”

How do I solve this? Thanks in advance.

1 Like

Hi @vishnu.shanker.au,

Welcome to the Auth0 Community!

Thank you for sharing a detailed problem statement.

Have you configured the session lifetimes for your tenant?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.