From 44ce3a3c98e7660930b219d26255d1e6fbffc635 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 10 Apr 2023 19:35:38 +0100 Subject: [PATCH] Change placement of constant --- .../AuthenticationFlow/EmailLoginForm.tsx | 2 +- .../AuthenticationFlow/GitHubButton.tsx | 2 +- .../AuthenticationFlow/GoogleButton.tsx | 2 +- .../AuthenticationFlow/ResetPasswordForm.tsx | 2 +- .../TriggerVerifyAccount.tsx | 2 +- src/components/Authenticator/authenticator.ts | 2 +- src/components/Navigation/Navigation.astro | 5 ----- src/components/Navigation/navigation.ts | 2 +- src/components/Setting/ChangePasswordForm.tsx | 2 +- src/components/Setting/UpdateProfileForm.tsx | 2 +- src/hooks/use-auth.ts | 3 +-- src/lib/constants.ts | 8 -------- src/lib/http.ts | 2 +- src/lib/jwt.ts | 2 ++ src/pages/profile/index.astro | 19 ------------------- src/pages/settings/change-password.astro | 10 ---------- src/pages/settings/profile.astro | 10 ---------- 17 files changed, 13 insertions(+), 64 deletions(-) delete mode 100644 src/lib/constants.ts delete mode 100644 src/pages/profile/index.astro diff --git a/src/components/AuthenticationFlow/EmailLoginForm.tsx b/src/components/AuthenticationFlow/EmailLoginForm.tsx index e1ae7f15b..8a3b90827 100644 --- a/src/components/AuthenticationFlow/EmailLoginForm.tsx +++ b/src/components/AuthenticationFlow/EmailLoginForm.tsx @@ -1,9 +1,9 @@ import Cookies from 'js-cookie'; import type { FunctionComponent } from 'preact'; import { useState } from 'preact/hooks'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; import Spinner from '../Spinner'; import { httpPost } from '../../lib/http'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; const EmailLoginForm: FunctionComponent<{}> = () => { const [email, setEmail] = useState(''); diff --git a/src/components/AuthenticationFlow/GitHubButton.tsx b/src/components/AuthenticationFlow/GitHubButton.tsx index b95a958ec..7cf29065f 100644 --- a/src/components/AuthenticationFlow/GitHubButton.tsx +++ b/src/components/AuthenticationFlow/GitHubButton.tsx @@ -2,8 +2,8 @@ import { useEffect, useState } from 'preact/hooks'; import GitHubIcon from '../../icons/github.svg'; import SpinnerIcon from '../../icons/spinner.svg'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; import Cookies from 'js-cookie'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; type GitHubButtonProps = {}; diff --git a/src/components/AuthenticationFlow/GoogleButton.tsx b/src/components/AuthenticationFlow/GoogleButton.tsx index 002b26a29..993def800 100644 --- a/src/components/AuthenticationFlow/GoogleButton.tsx +++ b/src/components/AuthenticationFlow/GoogleButton.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'preact/hooks'; import Cookies from 'js-cookie'; import GoogleIcon from '../../icons/google.svg'; import SpinnerIcon from '../../icons/spinner.svg'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; type GoogleButtonProps = {}; diff --git a/src/components/AuthenticationFlow/ResetPasswordForm.tsx b/src/components/AuthenticationFlow/ResetPasswordForm.tsx index d512131a3..8ebbcf769 100644 --- a/src/components/AuthenticationFlow/ResetPasswordForm.tsx +++ b/src/components/AuthenticationFlow/ResetPasswordForm.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'preact/hooks'; import Spinner from '../Spinner'; import { httpPost } from '../../lib/http'; import Cookies from 'js-cookie'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; export default function ResetPasswordForm() { const [code, setCode] = useState(''); diff --git a/src/components/AuthenticationFlow/TriggerVerifyAccount.tsx b/src/components/AuthenticationFlow/TriggerVerifyAccount.tsx index 251a3827a..0979152ea 100644 --- a/src/components/AuthenticationFlow/TriggerVerifyAccount.tsx +++ b/src/components/AuthenticationFlow/TriggerVerifyAccount.tsx @@ -3,7 +3,7 @@ import ErrorIcon from '../../icons/error.svg'; import { useEffect, useState } from 'preact/hooks'; import Cookies from 'js-cookie'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; export function TriggerVerifyAccount() { const [isLoading, setIsLoading] = useState(true); diff --git a/src/components/Authenticator/authenticator.ts b/src/components/Authenticator/authenticator.ts index 76f9b24bb..2de9a1d5d 100644 --- a/src/components/Authenticator/authenticator.ts +++ b/src/components/Authenticator/authenticator.ts @@ -1,5 +1,5 @@ import Cookies from 'js-cookie'; -import { TOKEN_COOKIE_NAME } from '../../lib/constants'; +import {TOKEN_COOKIE_NAME} from "../../lib/jwt"; function easeInElement(el: Element) { el.classList.add('opacity-0', 'transition-opacity', 'duration-300'); diff --git a/src/components/Navigation/Navigation.astro b/src/components/Navigation/Navigation.astro index 66317528e..1e9cd4f22 100644 --- a/src/components/Navigation/Navigation.astro +++ b/src/components/Navigation/Navigation.astro @@ -91,11 +91,6 @@ import AccountDropdown from './AccountDropdown.astro'; -