Skip to content

Commit

Permalink
Merge pull request #202 from zstenger93/api_connections
Browse files Browse the repository at this point in the history
Api connections
  • Loading branch information
zstenger93 authored Jan 6, 2024
2 parents 706ac37 + f2e1620 commit 1299071
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function App() {
} else {
REDIRECT_URI = process.env.REACT_APP_REDIRECT_URI;
}

console.log(REDIRECT_URI);

useEffect(() => {
const storedLanguage = localStorage.getItem("i18nextLng");
if (storedLanguage && i18n.language !== storedLanguage) {
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/welcome_page/LoginVia42.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import React from "react";
import { WelcomeButtonStyle } from "../buttons/ButtonStyle";

const OAuth = async ({ navigate, redirect_uri }) => {
console.log("OAuth");
console.log(redirect_uri);
const auth = `${redirect_uri}/api/is_authenticated/`;
let response = await fetch(auth, {
credentials: "include",
});

let data = await response.json();
// console.log(data);
if (!data.is_authenticated) {
if (!data.is_authenticated) {
const authWindow = window.open(`${redirect_uri}/api/oauth/authorize/`);
while (!authWindow.closed) {
response = await fetch(auth, {
Expand Down

0 comments on commit 1299071

Please sign in to comment.