DEV Community

Discussion on: Firebase Google Sign in with React

Collapse
 
1akshat profile image
Akki • Edited

What if I want a user to redirect to login page on doing logout?
Is this a good idea?

import { Redirect } from "react-router-dom";
export const logOut = () => {
auth
.signOut()
.then(() => {
console.log("logged out..");
return ;
})
.catch((error) => {
console.warn(error.message);
});
};