Skip to content

Commit

Permalink
remove(login): remove temporary login from react frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 authored and spwoodcock committed Nov 27, 2024
1 parent 9a5de99 commit fc91a5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
30 changes: 0 additions & 30 deletions src/frontend/src/api/Login.ts

This file was deleted.

20 changes: 3 additions & 17 deletions src/frontend/src/components/LoginPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { useEffect } from 'react';
import React from 'react';
import CoreModules from '@/shared/CoreModules';
import { Modal } from '@/components/common/Modal';
import { useDispatch } from 'react-redux';
import { useLocation, useNavigate } from 'react-router-dom';
import { useLocation } from 'react-router-dom';
import { LoginActions } from '@/store/slices/LoginSlice';
import { osmLoginRedirect } from '@/utilfunctions/login';
import { TemporaryLoginService } from '@/api/Login';
import AssetModules from '@/shared/AssetModules';
import OSMImg from '@/assets/images/osm-logo.png';

type loginOptionsType = {
Expand All @@ -24,17 +22,10 @@ const loginOptions: loginOptionsType[] = [
image: OSMImg,
description: 'Edits made in FMTM will be credited to your OSM account.',
},
{
id: 'temp_account',
name: 'Temporary Account',
icon: <AssetModules.PersonIcon color="" sx={{ fontSize: '40px' }} className="fmtm-w-10 fmtm-h-10" />,
description: "If you're not an OSM user or prefer not to create an OSM account.",
},
];

const LoginPopup = () => {
const dispatch = useDispatch();
const navigate = useNavigate();
const location = useLocation();
const from = location.state?.from || '/';

Expand All @@ -44,18 +35,13 @@ const LoginPopup = () => {
if (selectedOption === 'osm_account') {
localStorage.setItem('requestedPath', from);
osmLoginRedirect();
} else {
await dispatch(TemporaryLoginService(`${import.meta.env.VITE_API_URL}/auth/temp-login`, from));
dispatch(LoginActions.setLoginModalOpen(false));
navigate(from);
}
};

const LoginDescription = () => {
return (
<div className="fmtm-flex fmtm-items-start fmtm-flex-col">
<div className="fmtm-text-2xl fmtm-font-bold fmtm-mb-1">Sign In</div>
<div className="fmtm-text-base fmtm-mb-5 fmtm-text-gray-700">Select an account type to sign in</div>
<div className="fmtm-text-2xl fmtm-font-bold fmtm-mb-4">Sign In</div>
<div className="fmtm-w-full fmtm-flex fmtm-flex-col fmtm-gap-4 fmtm-justify-items-center">
{loginOptions?.map((option) => (
<div
Expand Down

0 comments on commit fc91a5e

Please sign in to comment.