diff --git a/frontend/src/components/Auth/PasswordResetForm.tsx b/frontend/src/components/Auth/PasswordResetForm.tsx index 9e2fed1..07af4b3 100644 --- a/frontend/src/components/Auth/PasswordResetForm.tsx +++ b/frontend/src/components/Auth/PasswordResetForm.tsx @@ -1,7 +1,6 @@ import React, { useState } from "react"; import Input from "../Input/Input"; import Button from "../Input/Button"; -import { useAuth } from "../../context/AuthContext"; interface ResetPasswordData { newPassword: string; @@ -14,7 +13,7 @@ interface ResetPasswordErrors { } interface SubmitProps { - onSubmit: () => void; + onSubmit: (success: boolean) => void; token: string; } @@ -56,7 +55,6 @@ const PasswordResetForm: React.FC = ({ onSubmit, token }) => { const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); - onSubmit(); if (validateResetForm()) { try { @@ -74,6 +72,7 @@ const PasswordResetForm: React.FC = ({ onSubmit, token }) => { if (!response.ok) { const data = await response.json(); + onSubmit(false); throw new Error( data.error || "An error has occurred while resetting" ); diff --git a/frontend/src/components/Layout/Logo.tsx b/frontend/src/components/Layout/Logo.tsx index 9a30737..c693d38 100644 --- a/frontend/src/components/Layout/Logo.tsx +++ b/frontend/src/components/Layout/Logo.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { Link } from "react-router-dom"; interface LogoProps { variant?: "home" | "default"; @@ -8,24 +7,25 @@ interface LogoProps { const Logo: React.FC = ({ variant = "default" }) => { const gradient = "text-transparent group-hover:mx-1 transition-all"; return ( - - diff --git a/frontend/src/pages/ResetPasswordPage.tsx b/frontend/src/pages/ResetPasswordPage.tsx index f7e83cc..f14d21d 100644 --- a/frontend/src/pages/ResetPasswordPage.tsx +++ b/frontend/src/pages/ResetPasswordPage.tsx @@ -1,16 +1,18 @@ import React from "react"; import PasswordResetForm from "../components/Auth/PasswordResetForm"; -import { useParams, useNavigate } from "react-router-dom"; +import { useParams } from "react-router-dom"; const ResetPasswordPage: React.FC = () => { const { token } = useParams<{ token: string }>(); - const navigate = useNavigate(); const handlePasswordReset = (success: boolean) => { if (success) { alert("Password reset successful!"); - navigate("/"); - } + window.location.href = "/"; + } + else { + alert("Password reset failed."); + } }; if (!token) { diff --git a/frontend/src/pages/ResultsPage.tsx b/frontend/src/pages/ResultsPage.tsx index cbad4d7..07fc38e 100644 --- a/frontend/src/pages/ResultsPage.tsx +++ b/frontend/src/pages/ResultsPage.tsx @@ -48,7 +48,7 @@ const ResultsPage: React.FC = ({}) => {
  • navigate(`/user/${user.username}`)} + onClick={() => window.location.href = `/user/${user.username}`} > {user.is_live ? "🔴" : ""} {user.username}
  • @@ -63,7 +63,7 @@ const ResultsPage: React.FC = ({}) => {
  • navigate(`/${stream.username}`)} + onClick={() => window.location.href = `/${stream.username}`} > {stream.title} - {stream.username} - {stream.num_viewers} viewers