- Sử dụng useSWR để fetch và cache thông tin logged in user
- Cung cấp hàm login, logout
- Tích hợp vào giao diện và test hoàn chỉnh cái flow login / logout
Slide: https://drive.google.com/drive/folders/1p6EjDFBIk9eeoMfsr9z5ufCbhe1rzU8W?usp=sharing
———
#nextjs
#typescript
#nextjs_tutorial
———
VIDEO CHAPTERS:
Made by: Sinh Bùi Đình
Cảm ơn bạn nhiều nhé! ❤️
00:00 Purpose setting useAuth hook
00:40 Duplicate when use in components
01:20 Example create useAuth hook
02:50 Re-Explain options of useSWR
03:56 How to pass options to useSWR
04:40 Handle return elements of hook
05:10 Setting export element
05:50 Explain idea mutate when login, logout
08:20 Use hook login, logout in login page
09:50 Use profile by param return from hook
10:30 Explain how to pass params into hook & revalidateOnMount
11:15 Explain await mutate in hook
13:00 Logout problem and how to trace error
15:50 Example some case can use hook useAuth
17:00 Introduce next video (Protected Pages)
———
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/