openstatusHQ / openstatus

🏓 The open-source synthetic monitoring platform 🏓
https://openstatus.dev
GNU Affero General Public License v3.0
6.08k stars 385 forks source link

Remove clerk and use lucia #653

Closed thibaultleouay closed 4 months ago

thibaultleouay commented 7 months ago

Description

We should remove clerk and use lucia instead

We should do the migration for our current user

It will improved the DX for new users without the need to rely on a external third party

Upvote & Fund

Fund with Polar

pilcrowOnPaper commented 7 months ago

A simple database structure would be using 3 db tables:

The OAuth account table would look something like this:

field type description
id any
user_id string the user linked to the account
provider_id string "github" or "google"
provider_user_id string GitHub or Google user ID

So from Clerk, you need to export the user data and all OAuth providers linked to each user.

For OAuth, we recommend using Arctic to handle the callback.

pilcrowOnPaper commented 7 months ago

As for setting up Lucia, we have a Drizzle adapter and the docs have Next.js specific guides