Skip to content

Commit

Permalink
Merge pull request #4552 from activepieces/metabase
Browse files Browse the repository at this point in the history
chore: metabase
  • Loading branch information
abuaboud committed Apr 24, 2024
2 parents 8d7ccfb + a4ab502 commit ae0edcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/pieces/community/metabase/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@activepieces/piece-metabase",
"version": "0.0.3"
"version": "0.0.4"
}
3 changes: 2 additions & 1 deletion packages/pieces/community/metabase/src/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type EncryptedObject = {

const algorithm = 'aes-256-cbc';
const ivLength = 16;
const SESSION_TOKEN_KEY = '_session_token';
const SESSION_TOKEN_KEY = 'metabase:_session_token';

function encryptString(inputString: string, key: string): EncryptedObject {
const iv = crypto.randomBytes(ivLength); // Generate a random initialization vector
Expand Down Expand Up @@ -128,6 +128,7 @@ export async function queryApiAndHandleRefresh(
if (httpError.response.status === 401) {
const sessionToken = await refreshSessionToken(auth);
await storeSessionToken(sessionToken, encryptionKey as string, store);
request.headers!['X-Metabase-Session'] = sessionToken;
return (await httpClient.sendRequest(request)).body;
}
throw error;
Expand Down

0 comments on commit ae0edcd

Please sign in to comment.