Mention slashtags auth in README

This also makes SLASHTAGS_SECRET optional.
If none is set, random bytes will be generated. This is useful for local development.
This commit is contained in:
ekzyis 2023-02-09 02:04:50 +01:00 committed by Keyan
parent 0d0940069a
commit c941c76292
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,9 @@ LOGIN_EMAIL_FROM=<YOUR FROM ALIAS>
# lnurl-auth
LNAUTH_URL=<YOUR PUBLIC TUNNEL TO LOCALHOST, e.g. NGROK>
# slashtags
SLASHTAGS_SECRET=
#######################################################
# LND / OPTIONAL #
# if you want to work with payments you'll need these #

View File

@ -19,7 +19,7 @@ async function createProfile (slashtag) {
const slashtags = global.slashtags || (() => {
console.log('initing slashtags')
const sdk = new SDK({ primaryKey: Buffer.from(process.env.SLASHTAGS_SECRET, 'hex') })
const sdk = new SDK({ primaryKey: process.env.SLASHTAGS_SECRET ? Buffer.from(process.env.SLASHTAGS_SECRET, 'hex') : undefined })
// Get the default slashtag
const slashtag = sdk.slashtag()