Skip to content
Permalink
Browse files

Use env variable

  • Loading branch information
cavis committed Apr 30, 2019
1 parent 390411c commit 6811a6d16f187bad0e2e9da8d955a8011760deba
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/signer.js
@@ -4,7 +4,8 @@ const SIGN_PARAM = 's'
/**
* Sign a string
*/
exports.sign = (str, secret = 'secret') => {
exports.sign = (str, secret) => {
secret = secret || process.env['SIGNER_SECRET'] || 'some-secret'
const hmac = crypto.createHmac('sha256', secret)
return hmac.update(str || '').digest('base64').replace(/\+|\/|=/g, match => {
if (match === '+') {

0 comments on commit 6811a6d

Please sign in to comment.
You can’t perform that action at this time.