chore: take lnurl-auth-host out of file to .env

This commit is contained in:
MTG2000
2022-06-01 21:33:54 +03:00
parent d5be48f3be
commit ffbc839806
3 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
const lnurl = require('lnurl')
const crypto = require('crypto')
const { prisma } = require('../../prisma')
const { CONSTS } = require('../../utils')
async function generateSecret() {
@@ -57,7 +58,7 @@ function removeExpiredHashes() {
}
async function generateAuthUrl() {
const hostname = 'http://localhost:8888/dev/auth/login'
const hostname = CONSTS.LNURL_AUTH_HOST;
const secret = await generateSecret()
addHash(createHash(secret))
const url = `${hostname}?tag=login&k1=${secret}`

View File

@@ -1,9 +1,11 @@
const BOLT_FUN_LIGHTNING_ADDRESS = 'johns@getalby.com'; // #TODO, replace it by bolt-fun lightning address if there exist one
const JWT_SECRET = process.env.JWT_SECRET;
const LNURL_AUTH_HOST = process.env.LNURL_AUTH_HOST
const CONSTS = {
JWT_SECRET,
BOLT_FUN_LIGHTNING_ADDRESS,
LNURL_AUTH_HOST
}
module.exports = CONSTS;

View File

@@ -14,7 +14,6 @@ export default function LoginPage() {
const meQuery = useMeQuery({
onCompleted: (data) => {
if (data.me) {
setIsLoggedIn(true);
meQuery.stopPolling();