Skip to content

Commit

Permalink
Merge pull request #1 from zion-off/login-bug
Browse files Browse the repository at this point in the history
Login bug
  • Loading branch information
zion-off authored May 29, 2024
2 parents 7f402f6 + 473cf3f commit 4d8e4a1
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified back-end/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion back-end/services/home.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function generateText(transcript, nameCookie, req) {
const response = await axios.post(
"https://api.openai.com/v1/completions",
{
model: "text-davinci-003",
model: "gpt-3.5-turbo-instruct",
prompt: `From most preferred to least preferred, my partner's love languages are: ${first}, ${second}, ${third}, ${fourth}, and ${fifth}. ${transcript}. Answer based on the given information, and be creative, but don't give me a list of their love languages or step by step instructions.`,
temperature: 0.7,
max_tokens: 256,
Expand Down
4 changes: 2 additions & 2 deletions front-end/src/pages/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Home() {
useEffect(() => {
// send the request to the server api, including the Authorization header with our JWT token in it
axios
.get("https://8heart.zzzzion.com/back-end/protected/home/", {
.get("http://localhost:8000/protected/home/", {
headers: { Authorization: `JWT ${jwtToken}` }, // pass the token, if any, to the server
})
.then((res) => {
Expand All @@ -46,7 +46,7 @@ function Home() {
const fetchData = async () => {
try {
const response = await axios.post(
"https://8heart.zzzzion.com/back-end/home/",
"http://localhost:8000/home/",
{ transcript: transcript, nameCookie: myName },
{
headers: {
Expand Down
4 changes: 3 additions & 1 deletion front-end/src/pages/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ const Login = (props) => {
const handleSubmit = async (e) => {
e.preventDefault();

console.log("given username: " + e.target.username.value);;
console.log("given password: " + e.target.password.value);;
try {
const requestData = {
username: e.target.username.value,
password: e.target.password.value,
};

const response = await axios.post(
`https://8heart.zzzzion.com/back-end/auth/login`,
`http://localhost:8000/auth/login`,
requestData
);

Expand Down
2 changes: 1 addition & 1 deletion front-end/src/pages/signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Signup = (props) => {
};
// send a POST request with the data to the server api to authenticate
const response = await axios.post(
`https://8heart.zzzzion.com/back-end/auth/register`,
`http://localhost:8000/auth/register`,
requestData
);
// store the response data into s the data state variable
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/pages/signupmessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function SignupMessage() {
async function generateLink() {
try {
console.log('myName: ', myName);
const response = await axios.post("https://8heart.zzzzion.com/back-end/linkinfo", {
const response = await axios.post("http://localhost:8000/linkinfo", {
nameCookie: myName,
});
setLink(response.data);
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/pages/survey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function SurveyComponent() {
survey.onComplete.add((sender, options) => {
const values = sender.data;
console.log(values);
axios.post('https://8heart.zzzzion.com/back-end/ranking/update', { uniqueLink, loveLanguages: values["love-languages"] }, { withCredentials: true })
axios.post('http://localhost:8000/ranking/update', { uniqueLink, loveLanguages: values["love-languages"] }, { withCredentials: true })
.then(response => {
console.log(response.data);
})
Expand Down
1 change: 1 addition & 0 deletions front-end/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "/api" }] }

0 comments on commit 4d8e4a1

Please sign in to comment.