Skip to content
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

[bug]failed to refresh token #241

Open
JYXL1 opened this issue Mar 20, 2023 · 0 comments
Open

[bug]failed to refresh token #241

JYXL1 opened this issue Mar 20, 2023 · 0 comments

Comments

@JYXL1
Copy link

JYXL1 commented Mar 20, 2023

when use refresh api after generate token api within 1 second, the new token will lose efficacy.
the source code as follow of RefreshAccessToken() in manager.go:

	if err := m.tokenStore.Create(ctx, ti); err != nil {
		return nil, err
	}

	if rcfg.IsRemoveAccess {
		// remove the old access token
		if err := m.tokenStore.RemoveByAccess(ctx, oldAccess); err != nil {
			return nil, err
		}
	}

	if rcfg.IsRemoveRefreshing && rv != "" {
		// remove the old refresh token
		if err := m.tokenStore.RemoveByRefresh(ctx, oldRefresh); err != nil {
			return nil, err
		}
	}

it maybe bug when refresh token within 1 second, the new access token will be removed, because it will be the same as old one.

@JYXL1 JYXL1 changed the title [bug]failed to fresh token [bug]failed to refresh token Mar 20, 2023
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

No branches or pull requests

1 participant