mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-18 10:44:08 +00:00
Refactor install wizard and mail configuration
This commit is contained in:
21
resources/scripts/features/installation/install-auth.ts
Normal file
21
resources/scripts/features/installation/install-auth.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { LS_KEYS } from '@/scripts/config/constants'
|
||||
import * as localStore from '@/scripts/utils/local-storage'
|
||||
|
||||
export function setInstallWizardAuth(token: string, companyId?: number | string | null): void {
|
||||
localStore.set(LS_KEYS.INSTALL_AUTH_TOKEN, token)
|
||||
setInstallWizardCompany(companyId)
|
||||
}
|
||||
|
||||
export function setInstallWizardCompany(companyId?: number | string | null): void {
|
||||
if (companyId === null || companyId === undefined || companyId === '') {
|
||||
localStore.remove(LS_KEYS.INSTALL_SELECTED_COMPANY)
|
||||
return
|
||||
}
|
||||
|
||||
localStore.set(LS_KEYS.INSTALL_SELECTED_COMPANY, String(companyId))
|
||||
}
|
||||
|
||||
export function clearInstallWizardAuth(): void {
|
||||
localStore.remove(LS_KEYS.INSTALL_AUTH_TOKEN)
|
||||
localStore.remove(LS_KEYS.INSTALL_SELECTED_COMPANY)
|
||||
}
|
||||
Reference in New Issue
Block a user