Skip to content

Commit

Permalink
Update SigninService.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Oct 3, 2024
1 parent ed15767 commit 77aef93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/SigninService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { GlobalEventService } from '@/core/GlobalEventService.js';
import { SigninEntityService } from '@/core/entities/SigninEntityService.js';
import { bindThis } from '@/decorators.js';
import { EmailService } from '@/core/EmailService.js';
import { NotificationService } from '@/core/NotificationService.js';
import type { FastifyRequest, FastifyReply } from 'fastify';

@Injectable()
Expand All @@ -25,6 +26,7 @@ export class SigninService {

private signinEntityService: SigninEntityService,
private emailService: EmailService,
private notificationService: NotificationService,
private idService: IdService,
private globalEventService: GlobalEventService,
) {
Expand All @@ -33,6 +35,8 @@ export class SigninService {
@bindThis
public signin(request: FastifyRequest, reply: FastifyReply, user: MiLocalUser) {
setImmediate(async () => {
this.notificationService.createNotification(user.id, 'login', {});

const record = await this.signinsRepository.insertOne({
id: this.idService.gen(),
userId: user.id,
Expand Down

0 comments on commit 77aef93

Please sign in to comment.