mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-04 15:04:24 +01:00
chore: take lnurl-auth-host out of file to .env
This commit is contained in:
@@ -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}`
|
||||
|
||||
@@ -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;
|
||||
@@ -14,7 +14,6 @@ export default function LoginPage() {
|
||||
|
||||
const meQuery = useMeQuery({
|
||||
onCompleted: (data) => {
|
||||
|
||||
if (data.me) {
|
||||
setIsLoggedIn(true);
|
||||
meQuery.stopPolling();
|
||||
|
||||
Reference in New Issue
Block a user