Skip to content

Commit

Permalink
fix(cli): create org if doesnt exist in fern token (#5631)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Jan 16, 2025
1 parent 98a2384 commit be4e0c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cli/cli/src/commands/token/token.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import chalk from "chalk";

import { createOrganizationIfDoesNotExist } from "@fern-api/auth";
import { createVenusService } from "@fern-api/core";
import { askToLogin } from "@fern-api/login";
import { TaskContext } from "@fern-api/task-context";
Expand All @@ -13,6 +14,9 @@ export async function generateToken({
taskContext: TaskContext;
}): Promise<void> {
const token = await askToLogin(taskContext);
if (token.type === "user") {
await createOrganizationIfDoesNotExist({ organization: orgId, token, context: taskContext });
}
const venus = createVenusService({ token: token.value });
const response = await venus.registry.generateRegistryTokens({
organizationId: FernVenusApi.OrganizationId(orgId)
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
- changelogEntry:
- summary: |
The Fern CLI is updated to create the organization if it doesn't exist when `fern token` is called.
type: fix
irVersion: 55
version: 0.50.5


- changelogEntry:
- summary: |
The preview server is updated such that local previews of both OpenRPC and OpenAPI (legacy parser)
Expand Down

0 comments on commit be4e0c2

Please sign in to comment.