Skip to content

Commit

Permalink
More debugging. Try running using test key.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Oct 1, 2024
1 parent 042347a commit b747372
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function getAPIKey(key: string): Promise<APIKey | null> {
return cachedKey;
}
const hashedKey = hashAPIKey(key);
console.log(`In getAPIKey: ${key}, ${hashedKey}`);
const apiKey = await APIKey.findOne({ where: { hashed_key: hashedKey } });
HASHER.reset();
if (apiKey !== null) {
Expand Down
6 changes: 3 additions & 3 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ export async function syncTables(force=false): Promise<void> {
export async function addAPIKey(): Promise<APIKey | void> {
// Set up some basic data that we're going to want
const hashedKey = hashAPIKey(process.env.CDS_API_KEY as string);
await APIKey.create({
const apiKey = await APIKey.create({
hashed_key: hashedKey,
client: "Tests",
});

const keys = await APIKey.findAll();
console.log(`There are ${keys.length} keys`);
console.log(apiKey);
return apiKey;
}

export async function addTestData() {
Expand Down

0 comments on commit b747372

Please sign in to comment.