Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 14, 2025

This PR implements a complete sign-up page that mirrors the existing sign-in functionality, providing users with a consistent authentication experience.

What's Added

New Sign-Up Page: Created app/frontend/pages/sessions/sign_up.tsx using Clerk's <SignUp> component, following the same pattern as the existing sign-in page for consistency.

Backend Routes & Controller: Added GET /sign_up route and sign_up method in SessionsController to handle the sign-up page rendering.

Complete Test Coverage: Added comprehensive tests for the sign-up GET endpoint and existing Clerk authentication flow, ensuring proper authentication behavior.

Environment Variables Cleanup: Removed unused Clerk environment variables from .env.example since sign-in and sign-up URLs are set directly in component props instead of environment variables.

Key Features

  • Consistent UI/UX: Uses the same AuthLayout and styling as the sign-in page
  • Clerk Integration: Properly integrates with the existing Clerk authentication flow using hardcoded component props
  • Automatic Redirect: Redirects users to dashboard after successful authentication
  • Terms & Privacy: Includes proper terms of service and privacy policy links

Authentication Flow

The implementation follows Clerk's standard authentication pattern where:

  • Authentication happens entirely on the frontend through Clerk's components
  • Backend authentication is handled through the __session cookie that Clerk manages
  • No custom POST endpoints are needed for token validation

Files Changed

  • config/routes.rb - Added sign-up GET route
  • app/controllers/sessions_controller.rb - Added sign-up handling method
  • app/frontend/pages/sessions/sign_up.tsx - New sign-up page component
  • spec/requests/sessions_spec.rb - Added comprehensive test coverage
  • .env.example - Removed unused Clerk environment variables

The implementation maintains the existing authentication patterns while providing the requested sign-up functionality. All tests pass and the code follows the project's linting and formatting standards.

Fixes #26.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@danielpaul
Copy link
Owner

@copilot clerk sign in and sign up urls set in the component props instead of env variables. remove from .env.example the ones that we don't need.

@Copilot Copilot AI changed the title [WIP] Create a sign up page similar to sign in page Create a sign up page similar to sign in page Aug 14, 2025
@Copilot Copilot AI requested a review from danielpaul August 14, 2025 14:38
Copilot finished work on behalf of danielpaul August 14, 2025 14:38
Copy link
Contributor Author

Copilot AI commented Aug 14, 2025

@copilot clerk sign in and sign up urls set in the component props instead of env variables. remove from .env.example the ones that we don't need.

I've updated the implementation to remove the unused Clerk environment variables from .env.example. The sign-in and sign-up components were already using hardcoded props (path="/sign_in" and path="/sign_up") instead of environment variables, so I removed the unused variables:

  • VITE_CLERK_SIGN_IN_URL
  • VITE_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL
  • VITE_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL

Only kept VITE_CLERK_PUBLISHABLE_KEY as it's still needed for Clerk authentication.

Changes in commit 2b867c6.

Copilot finished work on behalf of danielpaul August 14, 2025 14:44
end
end

def create_signup
Copy link
Owner

Choose a reason for hiding this comment

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

we don't need create_signup. this does not do anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the create_signup method as it was unnecessary. Clerk handles authentication entirely on the frontend through the __session cookie, so POST endpoints for token validation aren't part of the standard flow. Changes in commit 012a1d2.

end
end

def create
Copy link
Owner

Choose a reason for hiding this comment

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

we don't need create

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the create method as it was unnecessary. The POST /sign_in endpoint isn't needed since Clerk manages authentication through its own frontend flow. Changes in commit 012a1d2.

@danielpaul
Copy link
Owner

@copilot work on the changes

Copy link
Contributor Author

Copilot AI commented Aug 14, 2025

@copilot work on the changes

I've addressed the feedback by removing the unnecessary create and create_signup methods from the SessionsController, along with their corresponding POST routes and tests. These endpoints weren't needed since Clerk handles authentication entirely on the frontend. All tests are now passing. Changes in commit 012a1d2.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from danielpaul August 14, 2025 20:39
Copilot finished work on behalf of danielpaul August 14, 2025 20:39
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.

Create a sign up page similar to sign in page
2 participants