mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat(server): user connected accounts migration (#6103)
This commit is contained in:
@@ -160,8 +160,17 @@ export class OAuthController {
|
||||
}
|
||||
|
||||
await this.user.fulfillUser(externalAccount.email, {
|
||||
emailVerifiedAt: new Date(),
|
||||
registered: true,
|
||||
});
|
||||
await this.db.connectedAccount.create({
|
||||
data: {
|
||||
userId: user.id,
|
||||
provider,
|
||||
providerAccountId: externalAccount.id,
|
||||
...tokens,
|
||||
},
|
||||
});
|
||||
|
||||
return user;
|
||||
} else {
|
||||
@@ -191,7 +200,7 @@ export class OAuthController {
|
||||
) {
|
||||
return this.user.createUser({
|
||||
email: externalAccount.email,
|
||||
name: 'Unnamed',
|
||||
name: externalAccount.email.split('@')[0],
|
||||
avatarUrl: externalAccount.avatarUrl,
|
||||
emailVerifiedAt: new Date(),
|
||||
connectedAccounts: {
|
||||
|
||||
Reference in New Issue
Block a user