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

How Clerk Works #1735

Merged
merged 31 commits into from
Dec 13, 2024
Merged

How Clerk Works #1735

merged 31 commits into from
Dec 13, 2024

Conversation

jescalan
Copy link
Contributor

@jescalan jescalan commented Nov 21, 2024

It's been a long time coming, but finally it's here - how Clerk actually works, in the docs 🙌

Checklist

  • I have clicked on "Files changed" and performed a thorough self-review
  • I have added the "deploy-preview" label and added the preview link(s) to this PR description
  • All existing checks pass

@jescalan jescalan requested a review from a team as a code owner November 21, 2024 21:33
Copy link

Hey, here’s your docs preview: https://clerk.com/docs/pr/1735

Copy link
Contributor

@mwickett mwickett left a comment

Choose a reason for hiding this comment

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

This is legit awesome. Left a couple of random comments that popped up as I read it.

docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/tokens-signatures.mdx Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jescalan jescalan left a comment

Choose a reason for hiding this comment

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

Ok sorry this took so long to take a pass on, here's a first round. I have a couple more minor edits I'm pushing in a commit direct. I think there's a few more adjustments needed here, but it's close. Let's ship this week!

docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/cookies.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/cookies.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/cookies.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/cookies.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/cookies.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
docs/how-clerk-works/overview.mdx Outdated Show resolved Hide resolved
Clerk implements a hybrid authentication model that combines the benefits of both stateful and stateless approaches while mitigating their respective drawbacks, at the cost of adding a substantial amount of complexity to the implementation on Clerk's side. For a developer implementing Clerk, like you, this is all upside since the complexity is handled internally by Clerk. The hybrid model incorporates the same flow when signing in as the stateless flow, but with a few key innovations:

- A short-lived **session token** (60 seconds) combined with a background token refresh mechanism.
- A **client token** to verify the user's authentication state, in conjunction with the session token.
Copy link
Member

Choose a reason for hiding this comment

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

let's pair and drive it home more!

@alexisintech alexisintech merged commit c949131 into main Dec 13, 2024
4 checks passed
@alexisintech alexisintech deleted the je.how-clerk-works branch December 13, 2024 23:24
royanger pushed a commit that referenced this pull request Dec 16, 2024
Co-authored-by: Mike Wickett <[email protected]>
Co-authored-by: Alexis Aguilar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants