feat(providers): add Azure DevOps provider
☕️ Reasoning
This pull request adds the new AzureDevOpsProvider which allows authenticating with Azure DevOps and getting tokens for calling the APIs.
I accidentally reset my branch and my previous PR #4697 was closed.
🧢 Checklist
- [x] Documentation
- [ ] Tests
- [x] Ready to be merged
🎫 Affected issues
Implements: #4688
📌 Resources
- Contributing guidelines
- Code of conduct
- Contributing to Open Source
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| auth-docs | ❌ Failed (Inspect) | Aug 27, 2023 0:28am | ||
| auth-docs-nextra | ❌ Failed (Inspect) | Aug 27, 2023 0:28am |
2 Ignored Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| next-auth | ⬜️ Ignored (Inspect) | Aug 27, 2023 0:28am | ||
| next-auth-docs | ⬜️ Ignored (Inspect) | Visit Preview | Aug 27, 2023 0:28am |
Dear @ThangHuuVu, @lluia, please let me know if you want me to set up an application in Azure DevOps so you can verify that the provider works.
I decided to improve my pull request slightly (hope you find these additions helpful).
- Deployed NextAuth Example with Azure DevOps provider: https://next-auth-azure-devops.vercel.app
- The provider is copied “as-is” from this pull request and the full diff and usage can be found here: https://github.com/nawok/next-auth-example/compare/main...nawok:next-auth-example:provider/azure-devops?expand=1
LGTM too. I can confirm the preview URL login with AzureDevops worked for me :+1:
@ThangHuuVu - I also created a Test application and saved the clientId / clientSecret's in our 1Password :+1:
~~I also added a little fix for eslint’s incorrect suggestion to use ?? inside if condition.~~[^]
[^]: Removed after rebase on main.
next-auth:lint: next-auth/packages/next-auth/src/utils/detect-host.ts
next-auth:lint: 4:26 error Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator @typescript-eslint/prefer-nullish-coalescing
Other options to address that would be:
- either with a
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - or an explicit “booleaning”
Boolean(process.env.VERCEL) || Boolean(process.env.AUTH_TRUST_HOST)
+1. Would love to see this integrated.
@nawok is attempting to deploy a commit to the authjs Team on Vercel.
A member of the Team first needs to authorize it.
After updating this PR I noticed that the legacy label was applied. What should I update/improve to modernize it?
Hi @nawok to get rid of the legacy label, could you help move the change under: https://github.com/nextauthjs/next-auth/tree/main/packages/core/src/providers
And the docs do not need to be written manually anymore - make sure to add proper JSDoc comments, for example https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/auth0.ts
@ThangHuuVu, thanks, got it! I will take care of it and the one related to Dribbble. #5626
Is incorporating the docs as JSDoc a recommended way?
I found a separate Markdown has a better DX because of auto formatting and local preview. Please, have a look. There are some strange types generated on the bottom of the page and I cannot figure out what I am missing to make the page look nicer.
Is incorporating the docs as JSDoc a recommended way?
I found a separate Markdown has a better DX because of auto formatting and local preview. Please, have a look. There are some strange types generated on the bottom of the page and I cannot figure out what I am missing to make the page look nicer.
Yeah so we use the jsdoc comments to autogenerate the API reference docs. That way the documentation and types shown on hover inside your editor and the reference docs pages, are based on the same information. Of course it comes with some downsides, but having nice vscode built-in docs and maintaining only 1 set seems worth it.
In regard to the strange types at the bottom of the page, what exactly are you referring to?
Hi Nico, yeah, makes sense. Helps to keep the docs in sync as well.
I was talking about this options’s type signature. I just checked other providers and it seems like the type «explodes» if you add an extra field to it. I just thought I did something wrong but now I see that I’m not alone—and this is just the way it is.
Hi @ThangHuuVu, I will have a look today. Thank you for starting the review.
Hey @ThangHuuVu, I rebased my changes on top of the latest main, simplified it a bit, and I also redeployed the example app and here is its diff with the stock version.
Can you give it another try, please?
Regarding the images, I was hesitating because of Microsoft's guidelines regarding their assets. I can create a proper icon of matching style and size if you insist.
Don’t use Microsoft’s logos, icons, or designs, in any manner.
Re-added the endpoint URLs and updated the bug template dropdown options.
Woa, that is some strict guidelines. It should not be a blocker, though.
merged, thanks again @nawok!