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

Feat/add gitee provider #12475

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wushide
Copy link

@wushide wushide commented Jan 7, 2025

☕️ Reasoning

This will add a login method to Gitee. I have already resolved the type issue, as there was previously a type gap.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 1:14am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jan 8, 2025 1:14am

Copy link

vercel bot commented Jan 7, 2025

@wushide is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@halvaradop halvaradop left a comment

Choose a reason for hiding this comment

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

Great work! Just a few minimal changes. Additionally, could you provide documentation about the introduced provider, such as the APIs used or more resources on how to use the provider correctly?

Comment on lines +24 to +25
const baseUrl = "https://gitee.com";
const apiBaseUrl = "https://gitee.com/api/v5";
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not necessary to use these two variables, since apiBaseUrl only adds the path /api/v5 to baseUrl

Comment on lines +31 to +36
authorization: {
url: `${baseUrl}/oauth/authorize`,
params: {
scope: "",
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

If no additional configuration is needed, there’s no need to use the object. Simply use the API route directly.

Comment on lines +37 to +42
token: {
url: `${baseUrl}/oauth/token`,
params: {
grant_type: "authorization_code",
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

The grant_type is set to authorization_code by default, so there’s no need to use the object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants