diff --git a/interface/app/$libraryId/settings/client/account/Login.tsx b/interface/app/$libraryId/settings/client/account/Login.tsx
deleted file mode 100644
index b64ec4b6c..000000000
--- a/interface/app/$libraryId/settings/client/account/Login.tsx
+++ /dev/null
@@ -1,140 +0,0 @@
-import { useEffect, useState } from 'react';
-import { Controller } from 'react-hook-form';
-import { signIn } from 'supertokens-web-js/recipe/emailpassword';
-import { nonLibraryClient, useZodForm } from '@sd/client';
-import { Button, Form, Input, toast, z } from '@sd/ui';
-
-import ShowPassword from './ShowPassword';
-
-async function signInClicked(email: string, password: string) {
- try {
- const response = await signIn({
- formFields: [
- {
- id: 'email',
- value: email
- },
- {
- id: 'password',
- value: password
- }
- ]
- });
-
- if (response.status === 'FIELD_ERROR') {
- response.formFields.forEach((formField) => {
- if (formField.id === 'email') {
- // Email validation failed (for example incorrect email syntax).
- toast.error(formField.error);
- }
- });
- } else if (response.status === 'WRONG_CREDENTIALS_ERROR') {
- toast.error('Email & password combination is incorrect.');
- } else if (response.status === 'SIGN_IN_NOT_ALLOWED') {
- // the reason string is a user friendly message
- // about what went wrong. It can also contain a support code which users
- // can tell you so you know why their sign in was not allowed.
- toast.error(response.reason);
- } else {
- // sign in successful. The session tokens are automatically handled by
- // the frontend SDK.
- toast.success('Sign in successful');
- // Refresh the page to reflect the new session state.
- // FIXME: This is a temporary workaround. We will provide a better way to handle this.
- window.location.reload();
- }
- } catch (err: any) {
- if (err.isSuperTokensGeneralError === true) {
- // this may be a custom error message sent from the API by you.
- toast.error(err.message);
- } else {
- console.error(err);
- toast.error('Oops! Something went wrong.');
- }
- }
-}
-
-const LoginSchema = z.object({
- email: z.string().email(),
- password: z.string().min(6)
-});
-
-const Login = () => {
- const [showPassword, setShowPassword] = useState(false);
- const form = useZodForm({
- schema: LoginSchema,
- defaultValues: {
- email: '',
- password: ''
- }
- });
-
- return (
-
- );
-};
-
-export default Login;
diff --git a/interface/app/$libraryId/settings/client/account/Register.tsx b/interface/app/$libraryId/settings/client/account/Register.tsx
deleted file mode 100644
index 6dbc4ef15..000000000
--- a/interface/app/$libraryId/settings/client/account/Register.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-import { zodResolver } from '@hookform/resolvers/zod';
-import { useState } from 'react';
-import { Controller, useForm } from 'react-hook-form';
-import { signUp } from 'supertokens-web-js/recipe/emailpassword';
-import { Button, Form, Input, toast, z } from '@sd/ui';
-
-import ShowPassword from './ShowPassword';
-
-const RegisterSchema = z
- .object({
- email: z.string().email(),
- password: z.string().min(6),
- confirmPassword: z.string().min(6)
- })
- .refine((data) => data.password === data.confirmPassword, {
- message: 'Passwords do not match',
- path: ['confirmPassword']
- });
-type RegisterType = z.infer;
-
-async function signUpClicked(email: string, password: string) {
- try {
- const response = await signUp({
- formFields: [
- {
- id: 'email',
- value: email
- },
- {
- id: 'password',
- value: password
- }
- ]
- });
-
- if (response.status === 'FIELD_ERROR') {
- // one of the input formFields failed validaiton
- response.formFields.forEach((formField) => {
- if (formField.id === 'email') {
- // Email validation failed (for example incorrect email syntax),
- // or the email is not unique.
- toast.error(formField.error);
- } else if (formField.id === 'password') {
- // Password validation failed.
- // Maybe it didn't match the password strength
- toast.error(formField.error);
- }
- });
- } else if (response.status === 'SIGN_UP_NOT_ALLOWED') {
- // the reason string is a user friendly message
- // about what went wrong. It can also contain a support code which users
- // can tell you so you know why their sign up was not allowed.
- toast.error(response.reason);
- } else {
- // sign up successful. The session tokens are automatically handled by
- // the frontend SDK.
- toast.success('Sign up successful');
- // FIXME: This is a temporary workaround. We will provide a better way to handle this.
- window.location.reload();
- }
- } catch (err: any) {
- if (err.isSuperTokensGeneralError === true) {
- // this may be a custom error message sent from the API by you.
- toast.error(err.message);
- } else {
- toast.error('Oops! Something went wrong.');
- }
- }
-}
-
-const Register = () => {
- const [showPassword, setShowPassword] = useState(false);
- // useZodForm seems to be out-dated or needs
- //fixing as it does not support the schema using zod.refine
- const form = useForm({
- resolver: zodResolver(RegisterSchema),
- defaultValues: {
- email: '',
- password: '',
- confirmPassword: ''
- }
- });
- return (
-
- );
-};
-
-export default Register;
diff --git a/interface/app/$libraryId/settings/client/account/Tabs.tsx b/interface/app/$libraryId/settings/client/account/Tabs.tsx
deleted file mode 100644
index 015d67d77..000000000
--- a/interface/app/$libraryId/settings/client/account/Tabs.tsx
+++ /dev/null
@@ -1,169 +0,0 @@
-import { GoogleLogo, Icon } from '@phosphor-icons/react';
-import { Apple, Github } from '@sd/assets/svgs/brands';
-import { open } from '@tauri-apps/plugin-shell';
-import clsx from 'clsx';
-import { motion } from 'framer-motion';
-import { useState } from 'react';
-import { getAuthorisationURLWithQueryParamsAndSetState } from 'supertokens-web-js/recipe/thirdparty';
-import { Button, Card, Divider, toast, Tooltip } from '@sd/ui';
-
-import Login from './Login';
-import Register from './Register';
-
-const AccountTabs = ['Login', 'Register'] as const;
-
-type SocialLogin = {
- name: 'Github' | 'Google' | 'Apple';
- icon: Icon;
-};
-
-const SocialLogins: SocialLogin[] = [
- { name: 'Github', icon: Github },
- { name: 'Google', icon: GoogleLogo },
- { name: 'Apple', icon: Apple }
-];
-
-const Tabs = () => {
- const [activeTab, setActiveTab] = useState<'Login' | 'Register'>('Login');
-
- // Currently opens in App.
- const socialLoginHandlers = (name: SocialLogin['name']) => {
- return {
- Github: async () => {
- try {
- const authUrl = await getAuthorisationURLWithQueryParamsAndSetState({
- thirdPartyId: 'github',
-
- // This is where Github should redirect the user back after login or error.
- frontendRedirectURI: 'http://localhost:9420/api/auth/callback/github'
- });
-
- // we redirect the user to Github for auth.
- await open(authUrl);
- } catch (err: any) {
- if (err.isSuperTokensGeneralError === true) {
- // this may be a custom error message sent from the API by you.
- toast.error(err.message);
- } else {
- toast.error('Oops! Something went wrong.');
- }
- }
- },
- Google: async () => {
- try {
- const authUrl = await getAuthorisationURLWithQueryParamsAndSetState({
- thirdPartyId: 'google',
-
- // This is where Google should redirect the user back after login or error.
- // This URL goes on the Google's dashboard as well.
- frontendRedirectURI: 'spacedrive://-/auth'
- });
-
- /*
- Example value of authUrl: https://accounts.google.com/o/oauth2/v2/auth/oauthchooseaccount?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&include_granted_scopes=true&response_type=code&client_id=1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com&state=5a489996a28cafc83ddff&redirect_uri=https%3A%2F%2Fsupertokens.io%2Fdev%2Foauth%2Fredirect-to-app&flowName=GeneralOAuthFlow
- */
-
- // we redirect the user to google for auth.
- await open(authUrl);
- } catch (err: any) {
- if (err.isSuperTokensGeneralError === true) {
- // this may be a custom error message sent from the API by you.
- toast.error(err.message);
- } else {
- toast.error('Oops! Something went wrong.');
- }
- }
- },
- Apple: async () => {
- try {
- const authUrl = await getAuthorisationURLWithQueryParamsAndSetState({
- thirdPartyId: 'apple',
-
- // This is where Apple should redirect the user back after login or error.
- frontendRedirectURI: 'http://localhost:9420/api/auth/callback/apple'
- });
-
- // we redirect the user to Apple for auth.
- await open(authUrl);
- } catch (err: any) {
- if (err.isSuperTokensGeneralError === true) {
- // this may be a custom error message sent from the API by you.
- toast.error(err.message);
- } else {
- toast.error('Oops! Something went wrong.');
- }
- }
- }
- }[name]();
- };
-
- return (
-
-
- {activeTab === 'Login' ? : }
- {/* Disabling for now for demo purposes. We need to figure out on the backend how the tokens are recieved so we can a) store them in the frontend and b) use them as auth tokens for our cloud services. - @Rocky43007 */}
- {/*