Skip to content

CSO-Week3 React Task Done #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Update auth_required.js
  • Loading branch information
peepo77 authored Jun 29, 2022
commit 2d42a9e013e20d9489eb93ce31cbaaf6b134f2ab
2 changes: 1 addition & 1 deletion middlewares/auth_required.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function authRequired(){
const router = useRouter()
const { token } = useAuth()
useEffect(()=>{
if(!token){
if(token===undefined){
router.push('/login')
}
},[token])
Expand Down