Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Pull request overview
This PR creates a proper login page and adds a global user context, replacing the previous temporary auth page. It also updates app branding metadata.
Changes:
- Simplified the login page to a clean sign-in form with error handling and redirect on success
- Added a
UserProvidercontext to track authenticated user state app-wide - Updated app metadata to "TRCC Dashboard" branding
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/app/login/page.tsx | Replaced sign-in/sign-up test page with a focused login form |
| src/lib/client/userContext.tsx | New global user context provider using Supabase auth |
| src/app/layout.tsx | Wrapped app with UserProvider and updated metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| supabase.auth | ||
| .getUser() | ||
| .then(({ data }: { data: { user: User | null } }) => { | ||
| setUser(data.user); |
src/app/login/page.tsx
Outdated
| const { error: authError } = await signInWithEmail(email, password); | ||
|
|
||
| if (authError) { | ||
| setError(authError.message); | ||
| setLoading(false); | ||
| return; | ||
| } | ||
|
|
||
| router.push("/"); |
5e34197 to
5a5a6fa
Compare
There was a problem hiding this comment.
Pull request overview
This PR creates a proper login page with styling, replacing the previous temporary auth page. It also introduces a global user context provider and updates app branding metadata.
Changes:
- Refactored login page with styled form, error handling, and redirect on success
- Added
UserProvidercontext wrapping the app to expose authenticated user state globally - Added CSS variables and login-specific styles, plus Google Fonts import for Manrope
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/app/login/page.tsx | Replaced temp auth page with styled login form; removed sign-up |
| src/lib/client/userContext.tsx | New global user context with Supabase auth state tracking |
| src/app/layout.tsx | Wrapped app in UserProvider; updated metadata branding |
| src/app/globals.css | Added Manrope font import and variables.css import |
| src/styles/variables.css | New design tokens (colors, typography) |
| src/styles/login.module.css | New CSS module for login page styling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Modify this to follow Tailwind's @theme style. Some code in the app uses Tailwind so it should support both.
There was a problem hiding this comment.
On successful login redirect the user to /volunteers (Page is being implemented)
Implements #12
No CSS styling yet
This pull request introduces improvements to authentication and user context management in the application. The changes streamline the login flow, add a global user context, and update branding metadata. The most important changes are grouped below:
Authentication flow improvements:
src/app/login/page.tsxto remove the sign-up form, simplify state management, and improve error handling. The login form now redirects to the homepage on successful authentication and includes a "Forgot password?" link.User context management:
src/lib/client/userContext.tsxto provide a globalUserProvideranduseUserhook, enabling components to access the authenticated user and loading state throughout the app.src/app/layout.tsx) withUserProviderto ensure user context is available everywhere. [1] [2]Branding updates:
src/app/layout.tsxto reflect the new dashboard branding ("TRCC Dashboard" and "TRCC volunteer management dashboard").page tested locally:

user context exists: