mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-09 14:22:31 +00:00
admin sync fixes
This commit is contained in:
parent
6c370c13ee
commit
4a070eb09b
@ -4,12 +4,19 @@ $app.onBeforeServe().add((e) => {
|
|||||||
|
|
||||||
const log = mkLog(`admin-sync`)
|
const log = mkLog(`admin-sync`)
|
||||||
|
|
||||||
const { id, email, tokenKey, passwordHash } = JSON.parse(
|
const { id, email, tokenKey, passwordHash } = (() => {
|
||||||
$os.getenv(`ADMIN_SYNC`),
|
try {
|
||||||
|
return /** @type{{id:string, email:string, tokenKey:string,passwordHash:string}} */ (
|
||||||
|
JSON.parse($os.getenv(`ADMIN_SYNC`))
|
||||||
)
|
)
|
||||||
|
} catch (e) {
|
||||||
|
return { id: '', email: '', tokenKey: '', passwordHash: '' }
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
if (!email) {
|
if (!email) {
|
||||||
log(`Not active - skipped`)
|
log(`Not active - skipped`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = new DynamicModel({
|
const result = new DynamicModel({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user