Skip to content

Commit

Permalink
Fix displayed oauth callback endpoint url to include port
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Feb 5, 2025
1 parent d44c1e0 commit bd16ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions shared/studio/state/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface ServerVersion {
export class InstanceState extends Model({
_instanceId: prop<string | null>(null),
serverUrl: prop<string>(),
serverUrlWithPort: prop<string | null>(null),
authUsername: prop<string | null>(null),
authToken: prop<string | null>(),

Expand Down
8 changes: 6 additions & 2 deletions shared/studio/tabs/auth/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,18 @@ const AuthUrls = observer(function AuthUrls({
const databaseState = useDatabaseState();

const url = new URL(instanceState.serverUrl);
url.pathname = `db/${encodeURIComponent(databaseState.name)}/ext/auth`;
const urlWithPort = new URL(
instanceState.serverUrlWithPort ?? instanceState.serverUrl
);
url.pathname =
urlWithPort.pathname = `db/${encodeURIComponent(databaseState.name)}/ext/auth`;

const baseUrl = url.toString();

return (
<div className={styles.authUrls}>
<div className={styles.label}>OAuth callback endpoint:</div>
<CopyUrl url={`${baseUrl}/callback`} />
<CopyUrl url={`${urlWithPort.toString()}/callback`} />
<div
className={cn({[styles.disabled]: !builtinUIEnabled})}
style={{display: "contents"}}
Expand Down

0 comments on commit bd16ce4

Please sign in to comment.