Skip to content

Commit

Permalink
fix: authenticateRequest (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Feb 19, 2024
1 parent de23610 commit 187eb87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/req-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ export const getAuthorizationHeadersFromReq = (req) => {
}

result['Authorization'] = authorization;
} else if (apiKey) {
}

if (apiKey) {
result['Api-Key'] = apiKey;
} else if (personalToken) {
}

if (personalToken) {
result['Personal-Token'] = personalToken;
}

Expand Down
4 changes: 2 additions & 2 deletions pages/receipts/transactions/[id]/[filename].js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Receipt from '../../../../components/Receipt';

class TransactionReceipt extends React.Component {
static async getInitialProps(ctx) {
const isServer = Boolean(ctx);
const isServer = Boolean(ctx.req);
if (isServer) {
const { id, pageFormat } = ctx.query;
const authorizationHeaders = authenticateRequest(ctx.req);
Expand All @@ -19,7 +19,7 @@ class TransactionReceipt extends React.Component {
};
}

return { pageFormat: ctx?.query?.pageFormat };
return { pageFormat: ctx.query?.pageFormat };
}

static getReceiptFromData(transaction) {
Expand Down

0 comments on commit 187eb87

Please sign in to comment.