Skip to content

Commit

Permalink
account page
Browse files Browse the repository at this point in the history
  • Loading branch information
NishilJ committed Nov 17, 2024
1 parent 2e38e7c commit 700c8d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import LoginPage from './pages/LoginPage';
import RegisterPage from "./pages/RegisterPage";
import AboutPage from "./pages/AboutPage";
import HomePage from './pages/HomePage';
import AccountPage from './pages/AccountPage';

// Nishil
const App: React.FC = () => {
Expand All @@ -15,6 +16,7 @@ const App: React.FC = () => {
<Route path="/login" element={<LoginPage/>} />
<Route path="/register" element={<RegisterPage />} />
<Route path="/about" element={<AboutPage />} />
<Route path="/account" element={<AccountPage />} />
</Routes>
</Router>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoogleSSO.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom';
import { signInWithPopup } from 'firebase/auth';
import { auth, googleProvider } from '../firebaseconfig';
import { Button, Box } from '@mui/material';
import { GoogleIcon } from './customicons';
import { GoogleIcon } from './CustomIcons';

// Justin & Syed
const GoogleSSO: React.FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { updateProfile, updateEmail } from 'firebase/auth';
import { updateProfile, updateEmail, sendEmailVerification } from 'firebase/auth';
import { auth } from '../firebaseconfig';
import {
Button,
Expand All @@ -12,7 +12,7 @@ import {
defaultTheme
} from '@adobe/react-spectrum';

const AccountUpdate: React.FC = () => {
const AccountPage: React.FC = () => {
const [firstName, setFirstName] = useState<string>('');
const [lastName, setLastName] = useState<string>('');
const [email, setEmail] = useState<string>('');
Expand Down Expand Up @@ -40,6 +40,7 @@ const AccountUpdate: React.FC = () => {
// Update email
if (email !== user.email) {
await updateEmail(user, email);
await sendEmailVerification(user);
}

alert('Account information updated successfully.');
Expand Down Expand Up @@ -85,4 +86,4 @@ const AccountUpdate: React.FC = () => {
);
};

export default AccountUpdate;
export default AccountPage;

0 comments on commit 700c8d6

Please sign in to comment.