mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-14 07:02:30 +01:00
18 lines
433 B
JavaScript
18 lines
433 B
JavaScript
|
const html = require('choo/html');
|
||
|
const raw = require('choo/html/raw');
|
||
|
|
||
|
module.exports = function(state) {
|
||
|
// return '';
|
||
|
return state.cspNonce
|
||
|
? html`
|
||
|
<script nonce="${state.cspNonce}">
|
||
|
const userInfo = ${
|
||
|
state.user.loggedIn ? raw(JSON.stringify(state.user)) : 'null'
|
||
|
};
|
||
|
const downloadMetadata = ${
|
||
|
state.downloadMetadata ? raw(JSON.stringify(state.downloadMetadata)) : '{}'
|
||
|
};
|
||
|
</script>`
|
||
|
: '';
|
||
|
};
|