1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-13 22:54:15 +01:00
send/server/initScript.js
Danny Coates 7ccf462bf8 implemented PKCE auth (#921)
* implemented PKCE auth

* removed node-jose

* added PKCE tests
2018-09-14 11:00:33 -04:00

15 lines
339 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 downloadMetadata = ${
state.downloadMetadata ? raw(JSON.stringify(state.downloadMetadata)) : '{}'
};
</script>`
: '';
};