fix: fix login function directory

This commit is contained in:
MTG2000
2022-06-02 14:15:01 +03:00
parent b77800906d
commit 255c6f4604
10 changed files with 17 additions and 20 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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}`

View File

@@ -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() {

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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"
})

View File

@@ -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,