Skip to content

Commit

Permalink
rename X-Sequence-Token-Key header to X-Access-Key
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Oct 19, 2023
1 parent 3118f2e commit dc88bf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class SequenceAPIClient extends ApiRpc {
hostname: string,
public authorization?: {
jwtAuth?: string
tokenKey?: string
accessKey?: string
}
) {
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
Expand All @@ -21,14 +21,14 @@ export class SequenceAPIClient extends ApiRpc {
// if its been set on the api client
const headers: { [key: string]: any } = {}

const {jwtAuth, tokenKey} = this.authorization || {}
const { jwtAuth, accessKey } = this.authorization || {}

if (jwtAuth && jwtAuth.length > 0) {
headers['Authorization'] = `BEARER ${jwtAuth}`
}

if (tokenKey && tokenKey.length > 0) {
headers['X-Sequence-Token-Key'] = `${tokenKey}`
if (accessKey && accessKey.length > 0) {
headers['X-Access-Key'] = `${accessKey}`
}

// before the request is made
Expand Down
8 changes: 4 additions & 4 deletions packages/indexer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SequenceIndexerClient extends IndexerRpc {
hostname: string,
public authorization?: {
jwtAuth?: string
tokenKey?: string
accessKey?: string
}
) {
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
Expand All @@ -43,14 +43,14 @@ export class SequenceIndexerClient extends IndexerRpc {
// if its been set on the api client
const headers: { [key: string]: any } = {}

const {jwtAuth, tokenKey} = this.authorization || {}
const { jwtAuth, accessKey } = this.authorization || {}

if (jwtAuth && jwtAuth.length > 0) {
headers['Authorization'] = `BEARER ${jwtAuth}`
}

if (tokenKey && tokenKey.length > 0) {
headers['X-Sequence-Token-Key'] = `${tokenKey}`
if (accessKey && accessKey.length > 0) {
headers['X-Access-Key'] = `${accessKey}`
}

// before the request is made
Expand Down

0 comments on commit dc88bf3

Please sign in to comment.