mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-16 12:54:21 +01:00
fix: fix login function directory
This commit is contained in:
@@ -1,3 +1 @@
|
||||
|
||||
REACT_APP_GRAPHQL_END_POINT = https://makers.bolt.fun/.netlify/functions/graphql
|
||||
REACT_APP_AUTH_END_POINT = https://makers.bolt.fun/.netlify/functions/auth
|
||||
REACT_APP_API_END_POINT = https://makers.bolt.fu/.netlify/functions
|
||||
@@ -1,2 +1 @@
|
||||
REACT_APP_GRAPHQL_END_POINT = http://localhost:8888/dev/graphql
|
||||
REACT_APP_AUTH_END_POINT = http://localhost:8888/dev/auth
|
||||
REACT_APP_API_END_POINT = http://localhost:8888/dev
|
||||
@@ -1,3 +1,2 @@
|
||||
REACT_APP_FOR_GITHUB=true
|
||||
REACT_APP_GRAPHQL_END_POINT = https://makers.bolt.fun/.netlify/functions/graphql
|
||||
REACT_APP_AUTH_END_POINT = https://makers.bolt.fun/.netlify/functions/auth
|
||||
REACT_APP_API_END_POINT = https://makers.bolt.fun/.netlify/functions
|
||||
@@ -59,6 +59,7 @@ function removeExpiredHashes() {
|
||||
|
||||
async function generateAuthUrl() {
|
||||
const hostname = CONSTS.LNURL_AUTH_HOST;
|
||||
console.log(hostname);
|
||||
const secret = await generateSecret()
|
||||
await addHash(createHash(secret))
|
||||
const url = `${hostname}?tag=login&k1=${secret}`
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
const { prisma } = require('../../prisma');
|
||||
const LnurlService = require('../services/lnurl.service')
|
||||
const { prisma } = require('../prisma');
|
||||
const LnurlService = require('../auth/services/lnurl.service')
|
||||
const cookie = require('cookie')
|
||||
const jose = require('jose');
|
||||
const { CONSTS } = require('../../utils');
|
||||
const { CONSTS } = require('../utils');
|
||||
|
||||
|
||||
async function generateAuthUrl() {
|
||||
@@ -23,24 +23,24 @@ functions:
|
||||
method: get
|
||||
cors: true
|
||||
login:
|
||||
handler: functions/auth/login/index.handler
|
||||
handler: functions/login/login.handler
|
||||
events:
|
||||
- http:
|
||||
path: auth/login
|
||||
path: login
|
||||
method: post
|
||||
cors: true
|
||||
- http:
|
||||
path: auth/login
|
||||
path: login
|
||||
method: get
|
||||
cors: true
|
||||
logout:
|
||||
handler: functions/auth/logout/index.handler
|
||||
handler: functions/logout/logout.handler
|
||||
events:
|
||||
- http:
|
||||
path: auth/logout
|
||||
path: logout
|
||||
method: post
|
||||
cors: true
|
||||
- http:
|
||||
path: auth/logout
|
||||
path: logout
|
||||
method: get
|
||||
cors: true
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useMeQuery } from "src/graphql"
|
||||
|
||||
|
||||
const getLnurlAuth = async () => {
|
||||
const res = await fetch(process.env.REACT_APP_AUTH_END_POINT! + '/login')
|
||||
const res = await fetch(process.env.REACT_APP_API_END_POINT! + '/login')
|
||||
const data = await res.json()
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export default function LoginPage() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
fetch(process.env.REACT_APP_AUTH_END_POINT! + '/logout', {
|
||||
fetch(process.env.REACT_APP_API_END_POINT! + '/logout', {
|
||||
method: "GET",
|
||||
'credentials': "include"
|
||||
})
|
||||
|
||||
@@ -4,8 +4,8 @@ import { RetryLink } from "@apollo/client/link/retry";
|
||||
|
||||
let apiClientUri = '/.netlify/functions/graphql';
|
||||
|
||||
if (process.env.REACT_APP_GRAPHQL_END_POINT)
|
||||
apiClientUri = process.env.REACT_APP_GRAPHQL_END_POINT
|
||||
if (process.env.REACT_APP_API_END_POINT)
|
||||
apiClientUri = process.env.REACT_APP_API_END_POINT + '/graphql'
|
||||
|
||||
const httpLink = new HttpLink({
|
||||
uri: apiClientUri,
|
||||
|
||||
Reference in New Issue
Block a user