Skip to content

Commit

Permalink
Disable privileged access on blank accessKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltares committed Oct 9, 2024
1 parent aca639c commit 62c4723
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export let currentTime = new State<number>('currentTime', Date.now(), { hideLog:
export let myNodeNum = new State<number>('myNodeNum')
export let broadcastId = 4294967295
export let myNodeMetadata = new State<DeviceMetadata>('myNodeMetadata')
export let accessKey = new State<string>('accessKey', 'secret', { persist: true, hideLog: true })
export let accessKey = new State<string>('accessKey', undefined, { persist: true, hideLog: true })
export let packetLimit = new State<number>('packetLimit', 500, { persist: true })
export let apiHostname = new State<string>('apiHostname', undefined, { hideLog: true })
export let apiPort = new State<string>('apiPort', undefined, { hideLog: true })
Expand Down
2 changes: 1 addition & 1 deletion ui/src/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { enableAudioAlerts } from '../Settings.svelte'

export const userKey = writable(localStorage.getItem('userKey') || '')
userKey.subscribe((value) => localStorage.setItem('userKey', value))
export const hasAccess = derived([accessKey, userKey], ([$accessKey, $userKey]) => window.location.hostname == 'localhost' || !$accessKey || $accessKey == $userKey)
export const hasAccess = derived([accessKey, userKey], ([$accessKey, $userKey]) => window.location.hostname == 'localhost' || ($accessKey != '' && $accessKey == $userKey))
window['userKey'] = userKey

export function unixSecondsTimeAgo(seconds) {
Expand Down

0 comments on commit 62c4723

Please sign in to comment.