Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cli): replace $SESSION_TOKEN placeholder for external apps#17048

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 2 commits intomainfromcj/cli-open-external-session-token
Mar 24, 2025

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedMar 21, 2025
edited
Loading

Fixes an oversight in#17032

The FE has logic to replace the string$SESSION_TOKEN with a newly-minted session token.
This adds corresponding logic to thecoder open app command.

@johnstcnjohnstcn self-assigned thisMar 21, 2025
// strings in the URL with the actual session token.
// This is consistent behaviour with the frontend. See: site/src/modules/resources/AppLink/AppLink.tsx
func replacePlaceholderExternalSessionTokenString(client *codersdk.Client, appURL string) string {
if !strings.Contains(appURL, "$SESSION_TOKEN") {
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only supported format? Not e.g.${SESSION_TOKEN}?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Nope, it's justconst magicTokenString = "$SESSION_TOKEN";

return appURL
}

// We will just re-use the existing session token we're already using.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine for apps. For VS Code I think we generate a new one but since it’s long-lived in the editor, it makes sense to decouple them. Same doesn’t apply here.

Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks 👍

@johnstcnjohnstcn merged commit674f60f intomainMar 24, 2025
32 checks passed
@johnstcnjohnstcn deleted the cj/cli-open-external-session-token branchMarch 24, 2025 09:03
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 24, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@matifalimatifalimatifali approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@johnstcn@mafredri@matifali

[8]ページ先頭

©2009-2025 Movatter.jp