Skip to content

Conversation

@TotomInc
Copy link
Contributor

@TotomInc TotomInc commented Nov 7, 2025

  • Integrate GitLab OAuth support on route /auth/gitlab
    • New server route handler for /__nuxt_studio/auth/gitlab which points to /server/routes/auth/gitlab.get runtime method
    • Update /auth/admin to redirect to the proper provider as defined in the module config
  • Turn useGit into a shared composable, returns the proper git provider based on the module provider config
    • Added an abstract GitProvider interface
    • Add createGitLabProvider with methods to fetch, commit and push to remote repository
    • Updated createGitHubProvider with GitProvider abstract interface
    • This allows for easier implementation of Git providers in the future
    • Fetch GitLab files in base64, similar to GitHub provider
  • Add gitlab provider in user & module config
  • Add gitlab.applicationId, gitlab.applicationSecret and gitlab.instanceUrl module config properties with support for their own environment variables
  • Ensure encoding is properly set on each fetched file
    • Add ternaries to determine if base64 decode should be used based on the file encoding (base64 or utf-8)
  • Lot of variable renaming to ensure the context switch from GitHub-centric to "remote" in order to be more context agnostic
  • Updated various parts of the UI to display proper Git provider details (e.g. icon, name)
    • Added useGitProviderIcon composable which returns the correct Git provider icon based on Studio user provider config

See #65 for context (fixes #65)

What's missing

  • Test GitLab OAuth (working)
  • Test GitLab commit/push
  • Update studio front-end to be more agnostic toward Git providers
    • There's too much code specific to GitHub

@vercel
Copy link

vercel bot commented Nov 7, 2025

@TotomInc is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@TotomInc TotomInc marked this pull request as draft November 7, 2025 09:15
@TotomInc TotomInc changed the title draft: feat(oauth): gitlab support feat(oauth): gitlab support Nov 7, 2025
@TotomInc TotomInc force-pushed the feat/gitlab-integration branch from e83bdf9 to 963a4e7 Compare November 7, 2025 10:07
@TotomInc TotomInc marked this pull request as ready for review November 7, 2025 12:47
@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
content-studio Ready Ready Preview Comment Nov 17, 2025 1:12pm

@TotomInc
Copy link
Contributor Author

Can someone from the core-team review this PR please?

I believe all the changes required for GitLab provider support is done. I've done testing on our company's GitLab self-hosted repository, and it works well:

  • GitLab users can log-in with GitLab OAuth Application
  • Users can correctly navigate on the website and edit content
  • Nuxt Studio properly create git commits and push to the remote GitLab repository using GitLab API

Thanks! 🙂

cc @atinux @larbish @maximepvrt @farnabaz

@larbish
Copy link
Contributor

larbish commented Nov 10, 2025

Thanks a lot @TotomInc! I've already had a check at it and it looks pretty good to me! There is a refactor I would like to do before merging, I'll take care of it, just need to finish another big refactor I'm working on first 😄

@TotomInc
Copy link
Contributor Author

Alright awesome @larbish, feel free to ping me if necessary or if I can give some help in getting this merged 🙂

@larbish
Copy link
Contributor

larbish commented Nov 14, 2025

I did a small refactor:

  • move providers logic in a dedicated utils folder: utils/proviers/{provider}.ts
  • create a null provider (empty mock) for devMode
  • factorize code into a single useGitProvider composable

Ready to merge once @farnabaz validate the auth behaviour ✅

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 17, 2025

npm i https://pkg.pr.new/nuxt-content/studio/nuxt-studio@72

commit: ef77d29

@larbish larbish merged commit 43106e7 into nuxt-content:main Nov 17, 2025
1 of 2 checks passed
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.

Support for (self-hosted) GitLab

3 participants