Skip to content

Create login page#112

Open
jonathanqiao1 wants to merge 4 commits intomainfrom
frontend/login-page
Open

Create login page#112
jonathanqiao1 wants to merge 4 commits intomainfrom
frontend/login-page

Conversation

@jonathanqiao1
Copy link
Contributor

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:

  • Refactored src/app/login/page.tsx to 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.
  • Updated login form UI for clarity, accessibility, and usability, including improved labels, placeholders, and error display.

User context management:

  • Added src/lib/client/userContext.tsx to provide a global UserProvider and useUser hook, enabling components to access the authenticated user and loading state throughout the app.
  • Wrapped the app’s root layout (src/app/layout.tsx) with UserProvider to ensure user context is available everywhere. [1] [2]

Branding updates:

  • Changed app metadata in src/app/layout.tsx to reflect the new dashboard branding ("TRCC Dashboard" and "TRCC volunteer management dashboard").

page tested locally:
image

user context exists:

image

Copilot AI review requested due to automatic review settings March 14, 2026 04:35
@vercel
Copy link

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
trcc Ignored Ignored Mar 16, 2026 11:30pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UserProvider context 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);
Comment on lines +21 to +29
const { error: authError } = await signInWithEmail(email, password);

if (authError) {
setError(authError.message);
setLoading(false);
return;
}

router.push("/");
Copilot AI review requested due to automatic review settings March 16, 2026 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 UserProvider context 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>
Copilot AI review requested due to automatic review settings March 16, 2026 23:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify this to follow Tailwind's @theme style. Some code in the app uses Tailwind so it should support both.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On successful login redirect the user to /volunteers (Page is being implemented)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants