- Sử dụng useAuth hook
- Tạo component để quản lý việc render tuỳ vào logged in user
Slide: https://drive.google.com/drive/folders/1p6EjDFBIk9eeoMfsr9z5ufCbhe1rzU8W?usp=sharing
———
#nextjs
#protected_pages
#nextjs_tutorial
———
VIDEO CHAPTERS:
Made by: Sinh Bùi Đình
Cảm ơn bạn nhiều nhé! ❤️
00:14 Introduce install component AUTH for (Protected Pages)
00:40 Explain setting page per page
01:40 Explain setting by Layout
02:15 Setting common component AUTH
05:55 Idea check first loading in hook
07:10 Handle protect page when loading done
09:00 Flow check page about working with protect page
12:10 Handle act when login success for see full thread protect page
13:10 Apply Logout in layout have protect page
14:50 Good point of SWR
15:40 Issue when try to access protect page by router.push
16:15 Different between access protect page by router.push from login after logout instead go direct
17:20 Test all thread
17:50 Test case apply mutate = null instead of {} when logout
18:35 Test case apply mutate = undefined instead of {} when logout
19:55 How to apply protect page
———
Easy Frontend - Code xịn hơn mỗi ngày
🔥 Khoá học Javascript: https://course.ezfrontend.com/javascript
🎁 Khoá học ReactJS: https://course.ezfrontend.com/reactjs
🎯 Fan cứng Easy Frontend: https://www.youtube.com/channel/UCG2ovypNCpVOTFeY1YCocmQ/join
———
💰 Ủng hộ mình làm videos thì đóng góp qua MoMo/ZaloPay: 0901 309 729 nhé
———
Kết nối với mình:
- ✅ Follow facebook: https://www.facebook.com/nvhauesmn/
- 🎉 Fan page: https://www.facebook.com/learn.easyfrontend
- ❓ Group: https://www.facebook.com/groups/easyfrontend
- 💻 Github: https://github.com/paulnguyen-mn
- 💼 LinkedIn: https://www.linkedin.com/in/haunguyenmn/