20 lines
474 B
TypeScript
20 lines
474 B
TypeScript
import { storeJson } from '../fileModels/storeJson'
|
|
import { sdk } from '../sdk'
|
|
import { randomPassword } from '../utils'
|
|
|
|
export const taskSeedSpacedAuth = sdk.setupOnInit(async (effects) => {
|
|
const existing = await storeJson.read((s) => s.spacedAuth).once()
|
|
if (existing) return
|
|
|
|
await storeJson.merge(
|
|
effects,
|
|
{
|
|
spacedAuth: {
|
|
username: 'spaces',
|
|
password: randomPassword(),
|
|
},
|
|
},
|
|
{ allowWriteAfterConst: true },
|
|
)
|
|
})
|