mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
feat(server): use user model (#9710)
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
UnknownOauthProvider,
|
||||
} from '../../base';
|
||||
import { AuthService, Public } from '../../core/auth';
|
||||
import { UserService } from '../../core/user';
|
||||
import { Models } from '../../models';
|
||||
import { OAuthProviderName } from './config';
|
||||
import { OAuthAccount, Tokens } from './providers/def';
|
||||
import { OAuthProviderFactory } from './register';
|
||||
@@ -29,7 +29,7 @@ export class OAuthController {
|
||||
constructor(
|
||||
private readonly auth: AuthService,
|
||||
private readonly oauth: OAuthService,
|
||||
private readonly user: UserService,
|
||||
private readonly models: Models,
|
||||
private readonly providerFactory: OAuthProviderFactory,
|
||||
private readonly db: PrismaClient
|
||||
) {}
|
||||
@@ -137,9 +137,7 @@ export class OAuthController {
|
||||
return connectedUser.user;
|
||||
}
|
||||
|
||||
const user = await this.user.fulfillUser(externalAccount.email, {
|
||||
emailVerifiedAt: new Date(),
|
||||
registered: true,
|
||||
const user = await this.models.user.fulfill(externalAccount.email, {
|
||||
avatarUrl: externalAccount.avatarUrl,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user