Skip to content

BUG(Brev-1417): error on token refresh#230

Merged
carterabdallahbrev merged 9 commits into
mainfrom
login-flow-cli-refresh
May 12, 2025
Merged

BUG(Brev-1417): error on token refresh#230
carterabdallahbrev merged 9 commits into
mainfrom
login-flow-cli-refresh

Conversation

@carterabdallahbrev
Copy link
Copy Markdown
Contributor

@carterabdallahbrev carterabdallahbrev commented May 8, 2025

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

@carterabdallahbrev carterabdallahbrev changed the title error on token refresh BUG(Brev-1417): error on token refresh May 8, 2025
Copy link
Copy Markdown
Contributor

@tmonty12 tmonty12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread pkg/auth/kas.go Outdated
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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do a fmt.Print here
also can we put this in $HOME? or ~? Will write file resolve?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see change, I tested with "valid" token and it worked

Comment thread pkg/auth/kas.go
splitRefreshToken := strings.Split(refreshToken, ":")
if len(splitRefreshToken) != 2 {
return nil, fmt.Errorf("invalid refresh token")
// Write the invalid refresh token to the specified file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still forgot to add a log/println to warn end user something weird is happening

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to tell them that we wrote the refresh token somewhere?

@carterabdallahbrev carterabdallahbrev merged commit 435e615 into main May 12, 2025
8 checks passed
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.

3 participants