Skip to content

Commit

Permalink
Prefix input token with bearer (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
octref authored Feb 6, 2025
1 parent a0c5a77 commit fac3dd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
22 changes: 4 additions & 18 deletions client/src/components/ServerConnectionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ export default function ServerConnectionModal() {
/>
</Form.Group>
<Form.Group controlId="slashApiKeyInput">
<Form.Label>Dgraph Cloud API Key:</Form.Label>
<Form.Label>
Authorization Key (Bearer Token)
</Form.Label>
<Form.Control
type="text"
placeholder="Cloud API Key"
placeholder="••••••••••••"
value={activeServer.slashApiKey || ""}
onChange={e =>
dispatch(
Expand All @@ -148,22 +150,6 @@ export default function ServerConnectionModal() {
}
/>
</Form.Group>
<Form.Group controlId="authToken">
<Form.Label>Auth Token:</Form.Label>
<Form.Control
type="text"
placeholder="Auth Token"
value={activeServer.authToken || ""}
onChange={e =>
dispatch(
actions.setAuthToken(
activeServer.url,
e.target.value,
),
)
}
/>
</Form.Group>
</Tab>
</Tabs>
);
Expand Down
2 changes: 1 addition & 1 deletion client/src/lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function setCurrentServerQueryTimeout(timeout) {

export function setCurrentServerSlashApiKey(slashApiKey) {
clientStubOptions.headers["X-Auth-Token"] = slashApiKey;
clientStubOptions.headers["Authorization"] = slashApiKey;
clientStubOptions.headers["Authorization"] = "Bearer " + slashApiKey;
}

export function setCurrentServerAuthToken(authToken) {
Expand Down

0 comments on commit fac3dd1

Please sign in to comment.