Skip to content

Commit

Permalink
only return apikey when it has a value
Browse files Browse the repository at this point in the history
  • Loading branch information
rphovley committed Sep 22, 2024
1 parent 1384fe4 commit 5251a85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/app/src/utils/auth.util.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// function to get api key from local storage
const LOCAL_API_KEY = 'local_api_key'
function getLocalApiKey() {
return localStorage.getItem(LOCAL_API_KEY)
const apiKey = localStorage.getItem(LOCAL_API_KEY)
if (apiKey === 'undefined') {
return null
}
return apiKey
}

function setLocalApiKey(apiKey: string) {
if (apiKey === 'undefined') return
localStorage.setItem(LOCAL_API_KEY, apiKey)
}

Expand Down

0 comments on commit 5251a85

Please sign in to comment.