@@ -122,6 +122,7 @@ Provides authentication context to your application.
122122```
123123
124124** Props:**
125+
125126- ` config ` (required): Authentication configuration object
126127 - ` clientId ` : Google OAuth client ID
127128 - ` clientSecret ` : Google OAuth client secret
@@ -136,19 +137,12 @@ Provides authentication context to your application.
136137Access authentication state and methods.
137138
138139``` tsx
139- const {
140- isAuthenticated,
141- isLoading,
142- user,
143- error,
144- login,
145- logout,
146- handleCallback,
147- refreshToken,
148- } = useAuth ();
140+ const { isAuthenticated, isLoading, user, error, login, logout, handleCallback, refreshToken } =
141+ useAuth ();
149142```
150143
151144** Returns:**
145+
152146- ` isAuthenticated ` : Boolean indicating if user is authenticated
153147- ` isLoading ` : Boolean indicating if authentication is in progress
154148- ` user ` : User object with profile information (name, email, picture, etc.)
@@ -167,6 +161,7 @@ const { accessToken, isValid, refresh } = useToken();
167161```
168162
169163** Returns:**
164+
170165- ` accessToken ` : Current access token (string or null)
171166- ` isValid ` : Boolean indicating if the token is valid
172167- ` refresh() ` : Function to refresh the token
@@ -185,10 +180,11 @@ import { ProtectedRoute } from '@vector-institute/aieng-auth-react';
185180 <DashboardPage />
186181 </ProtectedRoute >
187182 }
188- />
183+ />;
189184```
190185
191186** Props:**
187+
192188- ` children ` : React children to render if authenticated
193189- ` redirectTo ` : Path to redirect to if not authenticated (default: '/')
194190
@@ -230,7 +226,7 @@ import { SessionStorageAdapter } from '@vector-institute/aieng-auth-core';
230226
231227<AuthProvider config = { authConfig } storage = { new SessionStorageAdapter ()} >
232228 { children }
233- </AuthProvider >
229+ </AuthProvider >;
234230```
235231
236232## Security Best Practices
0 commit comments