From d5ee3f272d8b668a8e9ff879bfb49f65fb394904 Mon Sep 17 00:00:00 2001 From: "Rayyan (Rayy)" Date: Tue, 19 Sep 2023 09:07:06 +0000 Subject: [PATCH] Added Route path for Signout --- src/App.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 2602ab7..f4467eb 100644 --- a/src/App.js +++ b/src/App.js @@ -2,7 +2,7 @@ import { FirebaseConfig } from "./config/Config" import { initializeApp } from "firebase/app" import { Routes, Route } from "react-router-dom" import { useState } from "react" -import { getAuth, createUserWithEmailAndPassword, onAuthStateChanged } from "firebase/auth"; +import { getAuth, createUserWithEmailAndPassword, onAuthStateChanged, signOut } from "firebase/auth"; import { Header } from "./components/Header" import './App.css' @@ -66,7 +66,11 @@ function App() { .catch((error) => console.log(error.message)) } - + const logOut = () => { + signOut(FBauth).then( () => { + // user is signed out + }) +} return (
@@ -75,6 +79,7 @@ function App() { } /> } /> } /> + } />
);