Skip to content

Commit

Permalink
Fix some type handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Jun 9, 2020
1 parent 4f7a9a3 commit 75cc674
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/2fa/server/code/EmailCheck.ts
Expand Up @@ -99,7 +99,7 @@ ${ t('If_you_didnt_try_to_login_in_your_account_please_ignore_this_email') }
const random = Random._randomString(6, '0123456789');
const encryptedRandom = bcrypt.hashSync(random, Accounts._bcryptRounds());
const expire = new Date();
const expirationInSeconds = parseInt(settings.get('Accounts_TwoFactorAuthentication_By_Email_Code_Expiration'));
const expirationInSeconds = parseInt(settings.get('Accounts_TwoFactorAuthentication_By_Email_Code_Expiration') as string, 10);

expire.setSeconds(expire.getSeconds() + expirationInSeconds);

Expand Down
2 changes: 1 addition & 1 deletion app/2fa/server/code/index.ts
Expand Up @@ -95,7 +95,7 @@ export function isAuthorizedForToken(connection: IMethodConnection, user: IUser,
export function rememberAuthorization(connection: IMethodConnection, user: IUser): void {
const currentToken = Accounts._getLoginToken(connection.id);

const rememberFor = parseInt(settings.get('Accounts_TwoFactorAuthentication_RememberFor'));
const rememberFor = parseInt(settings.get('Accounts_TwoFactorAuthentication_RememberFor') as string, 10);

if (rememberFor <= 0) {
return;
Expand Down
20 changes: 16 additions & 4 deletions app/livechat/server/lib/stream/agentStatus.ts
Expand Up @@ -9,19 +9,31 @@ let actionTimeout = 60000;
let action = 'none';
let comment = '';

settings.get('Livechat_agent_leave_action_timeout', function(_key: string, value: number) {
settings.get('Livechat_agent_leave_action_timeout', (_key, value) => {
if (typeof value !== 'number') {
return;
}
actionTimeout = value * 1000;
});

settings.get('Livechat_agent_leave_action', function(_key: string, value: boolean) {
settings.get('Livechat_agent_leave_action', (_key, value) => {
if (typeof value !== 'boolean') {
return;
}
monitorAgents = value;
});

settings.get('Livechat_agent_leave_action', function(_key: string, value: string) {
settings.get('Livechat_agent_leave_action', (_key, value) => {
if (typeof value !== 'string') {
return;
}
action = value;
});

settings.get('Livechat_agent_leave_comment', function(_key: string, value: string) {
settings.get('Livechat_agent_leave_comment', (_key, value) => {
if (typeof value !== 'string') {
return;
}
comment = value;
});

Expand Down
2 changes: 1 addition & 1 deletion ee/app/license/server/license.ts
@@ -1,4 +1,4 @@
import EventEmitter from 'events';
import { EventEmitter } from 'events';

import { Users } from '../../../../app/models/server';
import { resetEnterprisePermissions } from '../../authorization/server/resetEnterprisePermissions';
Expand Down
2 changes: 1 addition & 1 deletion server/main.d.ts
Expand Up @@ -24,7 +24,7 @@ declare module 'meteor/meteor' {
interface Error extends globalError {
error: string | number;
reason?: string;
details?: any;
details?: string | undefined;
}

const server: any;
Expand Down

0 comments on commit 75cc674

Please sign in to comment.