Fix issue on login when no hooks are registered

Fixes #5688
This commit is contained in:
rijkvanzanten
2021-05-14 18:52:20 -04:00
parent 6f51fa4483
commit e8ac74bb4c
2 changed files with 46 additions and 45 deletions

View File

@@ -17,6 +17,7 @@ import { createRateLimiter } from '../rate-limiter';
import { ActivityService } from '../services/activity';
import { AbstractServiceOptions, Accountability, Action, SchemaOverview, Session } from '../types';
import { SettingsService } from './settings';
import { merge } from 'lodash';
type AuthenticateOptions = {
email: string;
@@ -76,7 +77,7 @@ export class AuthenticationService {
});
if (updatedUser) {
user = updatedUser;
user = updatedUser.length > 0 ? updatedUser.reduce((val, acc) => merge(acc, val)) : user;
}
const emitStatus = (status: 'fail' | 'success') => {