mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-30 20:44:21 +01:00
change: re-fetch lnurl after delay
This commit is contained in:
@@ -9,10 +9,8 @@ const lnurlService = require('../../auth/services/lnurl.service');
|
||||
|
||||
|
||||
const isLoggedInHandler = async (req, res) => {
|
||||
// console.log(req.cookies);
|
||||
try {
|
||||
const login_session = req.cookies?.login_session;
|
||||
// console.log(login_session);
|
||||
if (login_session) {
|
||||
|
||||
const { payload } = await jose.jwtVerify(login_session, Buffer.from(JWT_SECRET), {
|
||||
@@ -38,8 +36,6 @@ const isLoggedInHandler = async (req, res) => {
|
||||
httpOnly: true,
|
||||
})
|
||||
.json({
|
||||
hash,
|
||||
token,
|
||||
logged_in: true
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
const { prisma } = require('../../prisma');
|
||||
const LnurlService = require('../../auth/services/lnurl.service')
|
||||
const serverless = require('serverless-http');
|
||||
const { getAuthTokenByHash, createHash, associateTokenToHash } = require('../../auth/services/lnurl.service');
|
||||
const { sessionsStore, createExpressApp } = require('../../modules');
|
||||
const { createHash, associateTokenToHash } = require('../../auth/services/lnurl.service');
|
||||
const { createExpressApp } = require('../../modules');
|
||||
const express = require('express');
|
||||
const jose = require('jose');
|
||||
const { JWT_SECRET } = require('../../utils/consts');
|
||||
|
||||
@@ -1,21 +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 SESSION_SECRET = process.env.SESSION_SECRET
|
||||
|
||||
const CORS_HEADERS = {
|
||||
'Access-Control-Allow-Origin': 'http://localhost:3000',
|
||||
'Access-Control-Allow-Headers': 'Content-Type',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE',
|
||||
'Access-Control-Allow-Credentials': true
|
||||
};
|
||||
|
||||
const CONSTS = {
|
||||
JWT_SECRET,
|
||||
BOLT_FUN_LIGHTNING_ADDRESS,
|
||||
LNURL_AUTH_HOST,
|
||||
CORS_HEADERS,
|
||||
SESSION_SECRET
|
||||
}
|
||||
|
||||
module.exports = CONSTS;
|
||||
Reference in New Issue
Block a user