Skip to content

Commit

Permalink
hopeful bug fix (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayko001 authored Aug 28, 2023
1 parent 47f5e17 commit 0751533
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,8 @@ impl ForeignDataWrapper for ClerkFdw {

let api_key = options.get("api_key").cloned();

let clerk_client = match options.get("api_key") {
Some(api_key) => Some(create_clerk_client(api_key)),
None => require_option("api_key_id", options)
.and_then(|key_id| get_vault_secret(&key_id))
.map(|api_key| create_clerk_client(&api_key)),
};
let clerk_client = None;

Self {
row_cnt: 0,
tgt_cols: Vec::new(),
Expand All @@ -216,6 +212,8 @@ impl ForeignDataWrapper for ClerkFdw {
_options: &HashMap<String, String>,
) {
if let Some(ref api_key) = self.api_key {
let clerk_client = create_clerk_client(api_key);
self.clerk_client = Some(clerk_client);
self.users = fetch_users(&self.clerk_client, api_key);
} else {
// Handle the case where API key is not available
Expand Down

0 comments on commit 0751533

Please sign in to comment.