Skip to content

Authenticated API not returning a user after a period of inactivity #43

@LuigiClaudio

Description

@LuigiClaudio

Hi, I'm new to this and I've started putting together an app that uses the react-netlify-identity bindings in order to achieve the level of flexibility I wanted for the authentication flow using Netlify Identity.

I've been experiences the following issue:
After a period of inactivity (I guess the one hour the token is valid), and given that remember was left to its default true, the user is shown as logged is however when checking the current context by pinging the authenticated API using for example the authedFetch method, no user object seems to exists. I can only see the identity object.

Am I missing any logic for handling such scenario?

I have the working app at this address https://toask.netlify.app/ - it's connected to FaunaDB using Apollo client for handling a list of plain todo list. This uses the context.user.sub to associate a list of todos to a user and as you can image, with the scanario mentioned above, no data is returned when no sub is found in the context.

If I log out the user from useIdentityContext(), the user object is correctly returned it would seem.

Anyone can suggest what I should look out for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions