skip to Main Content

Mongodb – If Token is not Present I want to redirect the page to login but its not working. When no token is present or logout i want to redirect the page login

I am Using React Router Dom V6 Here if(!localStorage.getItem("token")){ navigate("/login") } is not Working import React,{useState,useEffect} from 'react'; import axios from 'axios'; import { useNavigate } from 'react-router-dom'; const Home = (props) => { const [user,setUser]=useState(null); let navigate = useNavigate();…

VIEW QUESTION

Signup/login with facebook node js api

I've building an api backend for a mobile app built with react-native. And mobile developer has provided a json data file by mobile developer with the following data format. { "firstName": "John", "imageURL": "https:link-to-image.com/file.jpg", "lastName": "Joe", "linkURL": null, "middleName": null,…

VIEW QUESTION
Back To Top
Search