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

fix: oauth path building #3991

Merged
merged 3 commits into from
Aug 28, 2024
Merged

fix: oauth path building #3991

merged 3 commits into from
Aug 28, 2024

Conversation

mathnogueira
Copy link
Member

This PR fixes how we build oauth endpoint paths by replacing fmt.Sprintf with path.Join

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tracetest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 4:03pm

@@ -58,7 +59,7 @@ func (s *OAuthServer) GetAuthJWT() error {
return fmt.Errorf("failed to start oauth server: %w", err)
}

loginUrl := fmt.Sprintf("%soauth?callback=%s", s.frontendEndpoint, url)
loginUrl := path.Join(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
loginUrl := path.Join(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))
loginUrl := url.JoinPath(s.frontendEndpoint, fmt.Sprintf("oauth?callback=%s", url))

Copy link
Member Author

Choose a reason for hiding this comment

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

I had to create an alias for url as there is already an url var in this scope.

neturl net/url

@mathnogueira mathnogueira merged commit 0002614 into main Aug 28, 2024
38 checks passed
@mathnogueira mathnogueira deleted the feat/cli-path-build branch August 28, 2024 16:16
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