Skip to content

Fix RefreshToken() #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maverikou
Copy link

What kind of change does this PR introduce?

Refresh token never expires. Don't need to check for session expiration when refreshing.
This fixes a bug making it impossible to recover a session after the client has been offline for longer than the expiry time of the access token.

What is the current behavior?

Can't use a refresh token beyond the expiry time of the access token.

What is the new behavior?

Client can now try to refresh the access token for as long as it holds the refresh token.

@maverikou
Copy link
Author

Hi. I'm having the same issue here. Is there really any workaround ?

Are you saying this patch doesn't resolve the issue?

@zalito12
Copy link

I think this could solve #108

@zalito12
Copy link

I tested this changes and, actually, it helps but it doesn't fully fix #108

I needed to make a change in RetrieveSessionAsync. Here it always destroys the session and never try to refresh:

if (CurrentSession != null && CurrentSession.Expired())
{
    _debugNotification?.Log($"Loaded session has expired");
    DestroySession();
    return null;
}

I changed it so it checks if autorefresh is activated, and now it works fine, autorefresh the token everytime I open the app and the session has expired:

if (CurrentSession != null && CurrentSession.Expired() && !Options.AutoRefreshToken)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants