BUG(Brev-1417): error on token refresh#230
Merged
Merged
Conversation
theFong
requested changes
May 9, 2025
| if len(splitRefreshToken) != 2 { | ||
| return nil, fmt.Errorf("invalid refresh token") | ||
| // Write the invalid refresh token to the specified file | ||
| _ = os.WriteFile("/.brev/.invalid-refresh-token", []byte(refreshToken), 0o600) |
Member
There was a problem hiding this comment.
can we do a fmt.Print here
also can we put this in $HOME? or ~? Will write file resolve?
Contributor
Author
There was a problem hiding this comment.
see change, I tested with "valid" token and it worked
theFong
requested changes
May 9, 2025
| splitRefreshToken := strings.Split(refreshToken, ":") | ||
| if len(splitRefreshToken) != 2 { | ||
| return nil, fmt.Errorf("invalid refresh token") | ||
| // Write the invalid refresh token to the specified file |
Member
There was a problem hiding this comment.
I think we still forgot to add a log/println to warn end user something weird is happening
Contributor
Author
There was a problem hiding this comment.
we want to tell them that we wrote the refresh token somewhere?
theFong
approved these changes
May 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a user's refresh token expires due to inactivity, they will see a message and prompt indicating that, and directing them to login again
Also add flag --no-check-latest
that returns current compiled version without checking new versions