From 31d79fb67bb839b192000683adf776a2fdd5bba0 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Sun, 13 Mar 2022 01:26:26 -0800 Subject: [PATCH] some changes / fixes --- core/package.json | 3 +++ frontend/src/components/App/App.tsx | 12 +++------ frontend/src/components/Login.tsx | 5 ++-- frontend/src/components/UserInfo.tsx | 5 +--- frontend/src/index.tsx | 2 -- frontend/src/util/client.ts | 2 +- frontend/src/util/helpers.ts | 39 ++++++---------------------- periphery/package.json | 3 +++ types/types.d.ts | 6 +++++ 9 files changed, 27 insertions(+), 50 deletions(-) diff --git a/core/package.json b/core/package.json index a3709de5a..5277a5c6c 100644 --- a/core/package.json +++ b/core/package.json @@ -4,6 +4,9 @@ "main": "index.js", "author": "mbecker20", "license": "MIT", + "scripts": { + "start": "tsc && node build/main.js" + }, "devDependencies": { "@types/dockerode": "^3.3.3", "@types/fs-extra": "^9.0.13", diff --git a/frontend/src/components/App/App.tsx b/frontend/src/components/App/App.tsx index 7e97be8ec..86e676f59 100644 --- a/frontend/src/components/App/App.tsx +++ b/frontend/src/components/App/App.tsx @@ -1,19 +1,13 @@ -import { Component, createEffect, createResource, Match, Switch } from "solid-js"; -import { client, redirectTo } from "../.."; +import { Component, createResource, Match, Switch } from "solid-js"; +import { client } from "../.."; import styles from "./App.module.css"; import UserInfo from "../UserInfo"; -import { User } from "@oauth2/types" +import { User } from "@monitor/types" import Login from "../Login"; const App: Component = () => { const [user, { mutate }] = createResource(() => client.getUser()); - createEffect(() => { - if (redirectTo && user()) { - location.replace(`${redirectTo.url}/?token=${client.token}`) - } - }) - return (
diff --git a/frontend/src/components/Login.tsx b/frontend/src/components/Login.tsx index 8333601f7..4e433fb4b 100644 --- a/frontend/src/components/Login.tsx +++ b/frontend/src/components/Login.tsx @@ -1,11 +1,11 @@ import { Component } from "solid-js"; -import { loginGithub, loginGoogle } from "../util/helpers"; +import { loginGithub } from "../util/helpers"; import Input from "./util/Input"; import Grid from "./util/layout/Grid"; import { createStore } from "solid-js/store"; import Flex from "./util/layout/Flex"; import { client, pushNotification } from ".."; -import { User } from "@oauth2/types"; +import { User } from "@monitor/types"; const Login: Component<{ setUser: (user: User | false) => void }> = (p) => { const [info, set] = createStore({ @@ -60,7 +60,6 @@ const Login: Component<{ setUser: (user: User | false) => void }> = (p) => { - ); }; diff --git a/frontend/src/components/UserInfo.tsx b/frontend/src/components/UserInfo.tsx index 187acb833..f9342dbbc 100644 --- a/frontend/src/components/UserInfo.tsx +++ b/frontend/src/components/UserInfo.tsx @@ -2,7 +2,7 @@ import { Component, Show } from "solid-js"; import { getAuthProvider } from "../util/helpers"; import Flex from "./util/layout/Flex"; import Grid from "./util/layout/Grid"; -import { User } from "@oauth2/types"; +import { User } from "@monitor/types"; import { pushNotification } from ".."; const UserInfo: Component<{ user: User; logout: () => void }> = (p) => { @@ -15,9 +15,6 @@ const UserInfo: Component<{ user: User; logout: () => void }> = (p) => { - -
email: {p.user.email}
-