Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions frontend/src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BrowserRouter as Router, Route, Routes, Navigate } from "react-router-dom";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import App from "./App";
import LandingPage from "./modules/LandingPage/LandingPage";
import SignInPage from "./modules/AuthPage/SignInPage";
Expand Down Expand Up @@ -44,16 +44,7 @@ export const Root = () => (
<Routes>
<Route path="/" element={<App />}>
<Route index element={<LandingPage />} />
<Route
path="auth/google"
element={
<Navigate
to={`/auth-callback${window.location.search}`}
replace
/>
}
/>
<Route path="auth-callback" element={<AuthCallbackPage />} />
<Route path="auth/google" element={<AuthCallbackPage />} />

<Route element={<PublicOnlyRoute />}>
<Route path="sign-in" element={<SignInPage />} />
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/modules/AuthPage/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ const SignUpPage: React.FC = () => {

function handleSignUpWithGoogle(event: React.MouseEvent<HTMLButtonElement>) {
event.preventDefault();
const SERVER_BASE_URL = import.meta.env.VITE_SERVER_BASE_URL || window.location.origin;

const SERVER_BASE_URL = import.meta.env.VITE_SERVER_BASE_URL;
window.location.href = `${SERVER_BASE_URL}/api/v1/auth/google/url`;
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/modules/SnippetDetailsPage/DeleteModal.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import './DeleteModal.scss';

type LogOutModalProps = {
type DeleteModalProps = {
onClose: () => void;
onDelete: () => void;
}

const DeleteModal: React.FC<LogOutModalProps> = ({ onClose, onDelete }) => {
const DeleteModal: React.FC<DeleteModalProps> = ({ onClose, onDelete }) => {
return (
<div className="modalOverlay">
<div className="modal">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ const SnippetDetailsPage = () => {
}
});

useEffect(() => {
getSnippet();
}, [snippetId, accessToken]);
useEffect(() => {
if (location.state && (
location.state.title ||
Expand Down