fix(session-service): properly handle session store results

Previously, an undefined result in fetchUsernameForSessionId
was handled the same way as an error, rejecting the promise.

This fixes the behavior, only rejecting the promise if an error
is returned from the session store and properly returning
undefined if the session store returns that.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-10-07 18:30:42 +02:00
parent 4426d6f51a
commit 56e2270736
4 changed files with 27 additions and 6 deletions

View file

@ -6,11 +6,12 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { LoggerModule } from '../logger/logger.module';
import { Session } from './session.entity';
import { SessionService } from './session.service';
@Module({
imports: [TypeOrmModule.forFeature([Session])],
imports: [TypeOrmModule.forFeature([Session]), LoggerModule],
exports: [SessionService],
providers: [SessionService],
})