Initial pass at adding clerk login flow to tina#577
Initial pass at adding clerk login flow to tina#577
Conversation
❌ Deploy Preview for juel-staging failed. Why did it fail? →
|
❌ Deploy Preview for pss-scavenger-hunt failed. Why did it fail? →
|
✅ Deploy Preview for padp-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for juel-ancestry failed. Why did it fail? →
|
❌ Deploy Preview for gbof-c19nyc-staging failed. Why did it fail? →
|
❌ Deploy Preview for registro-project failed. Why did it fail? →
|
❌ Deploy Preview for universities-studying-slavery failed. Why did it fail? →
|
❌ Deploy Preview for juel-life failed. Why did it fail? →
|
❌ Deploy Preview for libertos failed. Why did it fail? →
|
❌ Deploy Preview for gamepossible failed. Why did it fail? →
|
|
Does this make Tina entirely dependent on Clerk, or is there still a way to set up local authentication? |
It just replaces Keycloak. The native Tina user management is still possible (and is the default unless you set a certain env variable to Expanding on this -- one thing that hasn't been done yet but could/should be is to implement the role-based permissions stuff for the default user management. Right now it's all tied to the way Clerk does organizations and roles, but in principle there's no reason we can't also have a |
|
A few testing notes:
|
session.remove() ends the current session token but leaves Clerk's browser-level sign-in state intact via cookies. signOut() clears both, ensuring a full logout. In practice the current code works because Clerk's UI re-prompts on the next page load, but signOut() is the documented way to fully end a Clerk session.
In SSR mode, any post/path slug is handled dynamically regardless of getStaticPaths. Unpublished content was accessible by direct URL. Now the page routes check published status before rendering.
- Shared getUserRole helper with dev-mode override for local testing - MutationObserver locks admin-only sidebar links (Settings, Branding, Internationalization, Navbar) with gray styling and lock icon - Ownership notice banner on posts/paths when viewing another user's content - beforeSubmit guard blocks saves for non-owners with clear error - Refactor PublishToggle to use shared role detection
use signOut() for Clerk logout
- CSS-disable all form fields (inputs, buttons, date picker, dropzone) - Hide status dot SVG, show lock icon in form header - Fix banner text and sizing (remove email, fix overflow) - Use useEffect for data attribute to avoid render loops - Add Pages to admin-only sidebar collections - Consolidate CSS selectors to target form scroll area
- cmsCallback only loads role-ui when TINA_PUBLIC_AUTH_USE_SSO is true - getUserRole defaults to admin when no Clerk user is found - Non-Clerk sites are unaffected by RBAC restrictions
Extensible `netlify.toml`
…s-ssr return 404 for unpublished posts and paths in SSR
add role-based UI restrictions for TinaCMS editors
Redeploy button
* admin redirect * don't crash site if the env vars aren't set * remove debug * reset config.json
* admin redirect * don't crash site if the env vars aren't set * remove debug * reset config.json * edge function fixes * slightly different approach
jamiefolsom
left a comment
There was a problem hiding this comment.
Staging is working for me as described. There is a short list of other issues to be addressed, but that need not block merging this PR. #602
| // Copy the "content" folder to the current directory | ||
| fs.cpSync(`${TEMP_DIR}/content`, './content', { recursive: true }); | ||
|
|
||
| // Append any custom Netlify config to the main one |
There was a problem hiding this comment.
See #594 -- both frames of the Tina Visual Editor have to be served from the same origin, likely the *.performant.studio subdomain, or else we get a cross origin security error.
In this PR
Migrates SSO from Keycloak to Clerk.

Notes and limitations
PublishTogglecomponent. Certainly possible, but a lot of busywork (maybe this is where Claude could actually step up and help?).How to test