-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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: show sso providers for next-auth in profile page #5303
base: main
Are you sure you want to change the base?
Conversation
@cy948 is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
👍 @cy948 Thank you for raising your pull request and contributing to our Community |
4c3e9c6
to
ff1eea3
Compare
{ | ||
children: <SSOProvidersList />, | ||
hidden: !isLoginWithNextAuth, | ||
label: 'profile.ssoProviders', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要补充i18n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -97,6 +105,25 @@ export class UserModel { | |||
}; | |||
}; | |||
|
|||
getUserSSOProviders = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样的写法不好。更优雅的写法是:
getUserSSOProviders = async (): Promise<AdapterAccount[]> => {
return this.db
.select({
expiresAt: nextauthAccounts.expires_at,
provider: nextauthAccounts.provider,
providerAccountId: nextauthAccounts.providerAccountId,
scope: nextauthAccounts.scope,
type: nextauthAccounts.type,
})
.from(nextauthAccounts)
.where(eq(nextauthAccounts.userId, this.userId));
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改了个写法 68ca31c
04763a6
to
6f02251
Compare
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information