Content-Length: 272936 | pFad | https://github.com/coder/coder/commit/a02ba6616b2e63eff9cee387f41b002fad216677

94 fix: fill session token when app is external (#17708) · coder/coder@a02ba66 · GitHub
Skip to content

Commit a02ba66

Browse files
fix: fill session token when app is external (#17708)
Fix #17704 During the [refactoring of WorkspaceApp response type](https://github.com/coder/coder/pull/17700/files#diff-a7e67944708c3c914a24a02d515a89ecd414bfe61890468dac08abde55ba8e96R112), I updated the logic to check if the session token should be injected causing external apps to not load correctly. To also avoid future confusions, we are only going to rely on the `app.external` prop to open apps externally instead of verifying if the URL does not use the HTTP protocol. I did some research and I didn't find out a use case where it would be a problem. I'm going to refactor this code very soon to allow opening apps from the workspaces page, so I will write the tests to cover this use case there. **Not included:** During my next refactoring I'm also going to change the code to support token injections directly in the HREF instead of making it happen during the click event.
1 parent 29bce8d commit a02ba66

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

site/src/modules/resources/AppLink/AppLink.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,7 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
106106

107107
event.preventDefault();
108108

109-
// This is an external URI like "vscode://", so
110-
// it needs to be opened with the browser protocol handler.
111-
const shouldOpenAppExternally =
112-
app.external && app.url?.startsWith("http");
113-
114-
if (shouldOpenAppExternally) {
109+
if (app.external) {
115110
// This is a magic undocumented string that is replaced
116111
// with a brand-new session token from the backend.
117112
// This only exists for external URLs, and should only

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/coder/coder/commit/a02ba6616b2e63eff9cee387f41b002fad216677

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy