Skip to content

Prepare cli auth & access token retrieval for api key hashing #65

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

Conversation

ben-fornefeld
Copy link
Member

@ben-fornefeld ben-fornefeld commented May 15, 2025

In order to be prepared for our upcoming migration to hashed api keys, this pr introduces the following changes:

  1. create new access tokens for cli auth & access token retrieval under dashboard/account
  2. remove api key return in /auth/cli, since it is not required in the cli

Additionally but not entangled, it adds route for manual team selection cookie updates, to fix changing teams on a non team dependent route (e.g /dashboard/account)

@ben-fornefeld ben-fornefeld self-assigned this May 15, 2025
@ben-fornefeld ben-fornefeld added the enhancement New feature or request label May 15, 2025
Copy link

linear bot commented May 15, 2025

Copy link

vercel bot commented May 15, 2025

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

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 2:09pm
web-juliett ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2025 2:09pm

Copy link
Contributor

@dobrac dobrac left a comment

Choose a reason for hiding this comment

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

LGTM, one nit

Also, did you test the new change with the current CLI?


if (!team || !selectedTeam) return

await fetch('/api/team/state', {
Copy link
Contributor

Choose a reason for hiding this comment

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

won't this fetch cause UI unresponsiveness (meaning delay after click)?

Copy link
Member Author

@ben-fornefeld ben-fornefeld May 15, 2025

Choose a reason for hiding this comment

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

lgtm, but this only changes cookies which means no matter the outcome, latency will be ~20 ms. the cookies kind of have to be set before doing the push/refresh, which is why we await. the router.push already has some delay in this scenario, so we don't compromise on "non-instant" navigation here anyways at the moment.

@ben-fornefeld ben-fornefeld merged commit 8415ef9 into main May 15, 2025
2 of 3 checks passed
@ben-fornefeld ben-fornefeld deleted the change-the-dashboard-authcli-endpoint-to-always-generate-new-e2b-1581 branch May 15, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants