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
2 changes: 1 addition & 1 deletion frontend/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ instance.interceptors.response.use(
},
);

function parseData(data: string) {
export function parseData(data: string) {
if (data.length != 0 || data || data != "") {
return JSON.parse(data);
}
Expand Down
35 changes: 35 additions & 0 deletions frontend/api/userApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import axios from "axios";
import { parseData } from "./Api";
const SERVER_URL = process.env.NEXT_PUBLIC_SERVER_URL + "/user";

export const instance = axios.create({
withCredentials: true,
baseURL: SERVER_URL,
timeout: 10000,
transformResponse: [
function (data: any) {
return parseData(data);
},
],
});

const userApi = {
async execute(
method: string,
resource: string,
data: any,
config: {} | undefined,
) {
return instance({
method: method,
url: resource,
data,
...config,
});
},
userInfo() {
return instance.get("/user-info")
}
}

export default userApi;
24 changes: 24 additions & 0 deletions frontend/app/account/login/oauth2/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";
/**
* Once a user logins with OAuth2 from backend service
* they should be brought here. This will quickly read
* the call authService which will make a request to
* the endpoint /user-info with the already attached
* cookie and save the User info.
*/
import authService from "@/services/auth.service";
import { useRouter } from "next/navigation";
import { useEffect } from "react";

export default function OauthLogin() {
const router = useRouter();

useEffect(() => {
authService.getUserInfoOauth2().then((user) => {
if (user) {
router.push("/");
}
})
}, [authService])

}
6 changes: 5 additions & 1 deletion frontend/components/Import/FilePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export default function FilePicker({ setUpload, setFile }: FilePickerProps) {
return <div>Error...</div>;
}
return (
<button className="btn btn-outline-info" onClick={() => openFilePicker()} title = "Import Bookmarks">
<button
className="btn btn-outline-info"
onClick={() => openFilePicker()}
title="Import Bookmarks"
>
<i className="bi bi-arrow-bar-up"> Upload File</i>
</button>
);
Expand Down
24 changes: 12 additions & 12 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@
"autoprefixer": "10.4.20",
"axios": "^1.9.0",
"axios-mock-adapter": "^2.1.0",
"bootstrap": "^5.3.5",
"bootstrap-icons": "^1.11.3",
"bootstrap": "^5.3.6",
"bootstrap-icons": "^1.13.1",
"dotenv": "^16.5.0",
"eslint": "9.17.0",
"eslint-config-next": "15.1.3",
"formik": "^2.4.6",
"jest": "^29.7.0",
"next": "^15.3.1",
"next": "^15.3.3",
"next-router-mock": "^0.9.13",
"postcss": "^8.5.3",
"postcss": "^8.5.4",
"react": "19.0.0",
"react-bootstrap": "^2.10.9",
"react-bootstrap": "^2.10.10",
"react-dom": "19.0.0",
"react-toastify": "^11.0.5",
"rxjs": "^7.8.2",
"sass": "^1.87.0",
"sass": "^1.89.2",
"tailwindcss": "3.4.17",
"typescript": "5.7.2",
"use-file-picker": "^2.1.2",
"use-file-picker": "^2.1.4",
"vite-tsconfig-paths": "^5.1.4",
"vitest-preview": "^0.0.1",
"yup": "^1.6.1"
Expand All @@ -52,12 +52,12 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@vitejs/plugin-react": "^4.4.1",
"@vitest/coverage-v8": "^3.1.2",
"@vitest/ui": "^3.1.2",
"@vitejs/plugin-react": "^4.5.2",
"@vitest/coverage-v8": "^3.2.3",
"@vitest/ui": "^3.2.3",
"jsdom": "^25.0.1",
"testcontainers": "^10.24.2",
"vitest": "^3.1.2"
"testcontainers": "^10.28.0",
"vitest": "^3.2.3"
},
"pnpm": {
"overrides": {
Expand Down
Loading
Loading