Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clerk migration #95

Closed
12 of 13 tasks
daryllimyt opened this issue Apr 23, 2024 · 0 comments · Fixed by #100
Closed
12 of 13 tasks

Clerk migration #95

daryllimyt opened this issue Apr 23, 2024 · 0 comments · Fixed by #100
Assignees
Labels
tracker Issues to track groups of issues

Comments

@daryllimyt
Copy link
Contributor

daryllimyt commented Apr 23, 2024

Motivation

  1. Supabase auth isn't robust enough for our usage. Move to Clerk.
  2. Supabase auth primitives are quite low-level and a lot of the authentication logic has to be managed directly by us
  3. Handling sessions and middleware is cumbersome

Implementation

  • Leverage middleware to decouple auth logic from application logic
    • This means we should only use redirects where necessary
  • Use Axios interceptors to apply authentication for all backend requests
  • Offload onboarding and new user flow responsibilities to custom Clerk publicMetadata for each user, and handled within a /onboarding component

Tasks

  • Migrate sign in/up page
    • Replaced these with Clerk builtins
  • Migrate middleware.ts
  • Migrate all supabase.auth usage to Clerk alternative
  • Update onboarding flow (creating first workflow) to use Clerk onboarding middleware
  • Update FastAPI backend
    • Update fastapi auth dependencies?
    • How to handle authing sessions
    • [v0] No need to replace Supabase as a DB provider, but decouple Supabase dependency
    • [v1] Replace supabase with generic postgres
  • Allow passing of TRACECAT__DISABLE_AUTH build flag to disable auth
    • This works nicely because we've centralized (almost) all auth logic into the Axios interceptor. We can conditionally apply the authenticated interceptor at application startup.
    • Update backend to change authentication strategy based on TRACECAT__DISABLE_AUTH flag
@daryllimyt daryllimyt self-assigned this Apr 23, 2024
@daryllimyt daryllimyt added the tracker Issues to track groups of issues label Apr 23, 2024
@daryllimyt daryllimyt changed the title Replace Supabase Auth with Clerk Clerk migration Apr 23, 2024
@daryllimyt daryllimyt linked a pull request Apr 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracker Issues to track groups of issues
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant