We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1384fe4 commit 5251a85Copy full SHA for 5251a85
1 file changed
packages/app/src/utils/auth.util.ts
@@ -1,10 +1,15 @@
1
// function to get api key from local storage
2
const LOCAL_API_KEY = 'local_api_key'
3
function getLocalApiKey() {
4
- return localStorage.getItem(LOCAL_API_KEY)
+ const apiKey = localStorage.getItem(LOCAL_API_KEY)
5
+ if (apiKey === 'undefined') {
6
+ return null
7
+ }
8
+ return apiKey
9
}
10
11
function setLocalApiKey(apiKey: string) {
12
+ if (apiKey === 'undefined') return
13
localStorage.setItem(LOCAL_API_KEY, apiKey)
14
15
0 commit comments