Commit ed0cfd2
committed
refactor: enhance authentication handling and user profile management
- Updated middleware to check authentication using Better Auth session and fallback to server-side user check.
- Simplified LoginForm by removing unused hooks and added console logs for better debugging.
- Modified ProtectedRoute to check user verification status using profile data.
- Refactored ProfileDataClient to utilize a new auth status hook for user data.
- Streamlined useAuth hook to fetch user profile and manage authentication state more efficiently.
- Removed reliance on Zustand store for auth state management in favor of Better Auth integration.1 parent acc1b8a commit ed0cfd2
8 files changed
Lines changed: 168 additions & 289 deletions
File tree
- components
- auth
- profile
- hooks
- lib
- api
- auth
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| |||
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | | - | |
| 39 | + | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
49 | 45 | | |
50 | 46 | | |
51 | 47 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 48 | + | |
| 49 | + | |
81 | 50 | | |
82 | 51 | | |
83 | 52 | | |
| |||
88 | 57 | | |
89 | 58 | | |
90 | 59 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 60 | + | |
98 | 61 | | |
99 | 62 | | |
100 | 63 | | |
| |||
103 | 66 | | |
104 | 67 | | |
105 | 68 | | |
106 | | - | |
| 69 | + | |
107 | 70 | | |
108 | 71 | | |
109 | 72 | | |
| |||
112 | 75 | | |
113 | 76 | | |
114 | 77 | | |
115 | | - | |
| 78 | + | |
116 | 79 | | |
117 | 80 | | |
118 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
0 commit comments