diff --git a/src/pages/auth.tsx b/src/pages/auth.tsx deleted file mode 100644 index b8421f4c..00000000 --- a/src/pages/auth.tsx +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Demo authentication to a legacy Vulcan backend - * - * For new application, see the /login endpoint instead, that uses Next directly - */ -//import { useForm } from "react-hook-form"; -import { VulcanMeteorHooks } from "@vulcanjs/meteor-legacy"; - -const AuthPage = () => { - const currentUserResult = VulcanMeteorHooks.useCurrentUser(); - - const [login] = VulcanMeteorHooks.useAuthenticateWithPassword(); - const [signup] = VulcanMeteorHooks.useSignup(); - const [logout] = VulcanMeteorHooks.useLogout(); - return ( -
-
-

Current User

- {currentUserResult.loading && "Loading current user..."} - {currentUserResult.error && "Can't get current user"} - {currentUserResult.data && - `Got current user: ${JSON.stringify(currentUserResult.data)}`} - {/**/} - {!( - currentUserResult && - currentUserResult.data && - currentUserResult.data.currentUser - ) && ( - <> -

Signup

-
{ - evt.preventDefault(); - const email = evt.target["email"].value; - const password = evt.target["password"].value; - await signup({ input: { email, password } }); - window.location.reload(); - }} - > - - - - - -
-

Login

-
{ - evt.preventDefault(); - const email = evt.target["email"].value; - const password = evt.target["password"].value; - const { data } = await login({ input: { email, password } }); - window.location.reload(); - //const { authenticateWithPassword } = data; - //const { token } = authenticateWithPassword; - //window.localStorage.setItem("meteor_login_token", token); - }} - > - - - - - -
- - )} - {currentUserResult && - currentUserResult.data && - currentUserResult.data.currentUser && ( - <> -

Logout

- - - )} -
- - -
- ); -}; - -// export default withApollo({ graphqlUri })(MyApp, { getDataFromTree }); - -export default AuthPage;